Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Side by Side Diff: Source/core/inspector/InspectorStyleSheet.cpp

Issue 23464095: WTF::notFound looks too much like a local variable. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010, Google Inc. All rights reserved. 2 * Copyright (C) 2010, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 if (offset < m_parsedText.length() && m_parsedText[offset] == ';') // Includ e semicolon into the property text. 355 if (offset < m_parsedText.length() && m_parsedText[offset] == ';') // Includ e semicolon into the property text.
356 ++offset; 356 ++offset;
357 357
358 const unsigned start = m_propertyRangeStart; 358 const unsigned start = m_propertyRangeStart;
359 const unsigned end = offset; 359 const unsigned end = offset;
360 ASSERT(start < end); 360 ASSERT(start < end);
361 String propertyString = m_parsedText.substring(start, end - start).stripWhit eSpace(); 361 String propertyString = m_parsedText.substring(start, end - start).stripWhit eSpace();
362 if (propertyString.endsWith(';')) 362 if (propertyString.endsWith(';'))
363 propertyString = propertyString.left(propertyString.length() - 1); 363 propertyString = propertyString.left(propertyString.length() - 1);
364 size_t colonIndex = propertyString.find(':'); 364 size_t colonIndex = propertyString.find(':');
365 ASSERT(colonIndex != notFound); 365 ASSERT(colonIndex != kNotFound);
366 366
367 String name = propertyString.left(colonIndex).stripWhiteSpace(); 367 String name = propertyString.left(colonIndex).stripWhiteSpace();
368 String value = propertyString.substring(colonIndex + 1, propertyString.lengt h()).stripWhiteSpace(); 368 String value = propertyString.substring(colonIndex + 1, propertyString.lengt h()).stripWhiteSpace();
369 // The property range is relative to the declaration start offset. 369 // The property range is relative to the declaration start offset.
370 unsigned topRuleBodyRangeStart = m_currentRuleDataStack.last()->ruleBodyRang e.start; 370 unsigned topRuleBodyRangeStart = m_currentRuleDataStack.last()->ruleBodyRang e.start;
371 m_currentRuleDataStack.last()->styleSourceData->propertyData.append( 371 m_currentRuleDataStack.last()->styleSourceData->propertyData.append(
372 CSSPropertySourceData(name, value, isImportant, false, isParsed, SourceR ange(start - topRuleBodyRangeStart, end - topRuleBodyRangeStart))); 372 CSSPropertySourceData(name, value, isImportant, false, isParsed, SourceR ange(start - topRuleBodyRangeStart, end - topRuleBodyRangeStart)));
373 m_propertyRangeStart = UINT_MAX; 373 m_propertyRangeStart = UINT_MAX;
374 } 374 }
375 375
(...skipping 1156 matching lines...) Expand 10 before | Expand all | Expand 10 after
1532 if (styleRule && styleRule->style() == pageStyle) 1532 if (styleRule && styleRule->style() == pageStyle)
1533 return i; 1533 return i;
1534 } 1534 }
1535 return UINT_MAX; 1535 return UINT_MAX;
1536 } 1536 }
1537 1537
1538 unsigned InspectorStyleSheet::ruleIndexByRule(const CSSRule* rule) const 1538 unsigned InspectorStyleSheet::ruleIndexByRule(const CSSRule* rule) const
1539 { 1539 {
1540 ensureFlatRules(); 1540 ensureFlatRules();
1541 size_t index = m_flatRules.find(rule); 1541 size_t index = m_flatRules.find(rule);
1542 return index == notFound ? UINT_MAX : static_cast<unsigned>(index); 1542 return index == kNotFound ? UINT_MAX : static_cast<unsigned>(index);
1543 } 1543 }
1544 1544
1545 bool InspectorStyleSheet::checkPageStyleSheet(ExceptionState& es) const 1545 bool InspectorStyleSheet::checkPageStyleSheet(ExceptionState& es) const
1546 { 1546 {
1547 if (!m_pageStyleSheet) { 1547 if (!m_pageStyleSheet) {
1548 es.throwDOMException(NotSupportedError); 1548 es.throwDOMException(NotSupportedError);
1549 return false; 1549 return false;
1550 } 1550 }
1551 return true; 1551 return true;
1552 } 1552 }
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
1815 1815
1816 RefPtr<MutableStylePropertySet> tempDeclaration = MutableStylePropertySet::c reate(); 1816 RefPtr<MutableStylePropertySet> tempDeclaration = MutableStylePropertySet::c reate();
1817 RuleSourceDataList ruleSourceDataResult; 1817 RuleSourceDataList ruleSourceDataResult;
1818 StyleSheetHandler handler(m_styleText, &m_element->document(), m_element->do cument().elementSheet()->contents(), &ruleSourceDataResult); 1818 StyleSheetHandler handler(m_styleText, &m_element->document(), m_element->do cument().elementSheet()->contents(), &ruleSourceDataResult);
1819 createCSSParser(&m_element->document())->parseDeclaration(tempDeclaration.ge t(), m_styleText, &handler, m_element->document().elementSheet()->contents()); 1819 createCSSParser(&m_element->document())->parseDeclaration(tempDeclaration.ge t(), m_styleText, &handler, m_element->document().elementSheet()->contents());
1820 return ruleSourceDataResult.first().release(); 1820 return ruleSourceDataResult.first().release();
1821 } 1821 }
1822 1822
1823 } // namespace WebCore 1823 } // namespace WebCore
1824 1824
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorDOMDebuggerAgent.cpp ('k') | Source/core/inspector/InspectorTimelineAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698