Changeset 121874 in webkit
- Timestamp:
- Jul 4, 2012 5:15:54 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/platform/chromium/TestExpectations
r121832 r121874 159 159 // CSS Variables are not yet enabled. 160 160 BUGWK85580 SKIP : fast/css/variables = PASS 161 BUGWK85580 SKIP : inspector/styles/variables = PASS 161 162 162 163 // CSS image-resolution is not yet enabled. -
trunk/LayoutTests/platform/gtk/TestExpectations
r121868 r121874 319 319 // CSS Variables are not yet enabled. 320 320 BUGWK85580 SKIP : fast/css/variables = PASS TEXT 321 BUGWK85580 SKIP : inspector/styles/variables = PASS 321 322 322 323 // CSS image-resolution is not yet enabled. -
trunk/LayoutTests/platform/mac/TestExpectations
r121794 r121874 12 12 // CSS Variables are not yet enabled. 13 13 BUGWK85580 SKIP : fast/css/variables = PASS 14 BUGWK85580 SKIP : inspector/styles/variables = PASS 14 15 15 16 // UndoManager is not yet enabled. -
trunk/LayoutTests/platform/qt/TestExpectations
r121794 r121874 74 74 // CSS Variables are not yet enabled. 75 75 BUGWK85580 SKIP : fast/css/variables = PASS 76 BUGWK85580 SKIP : inspector/styles/variables = PASS 76 77 77 78 // UndoManager is not yet enabled. -
trunk/Source/WebCore/ChangeLog
r121871 r121874 1 2012-07-04 Luke Macpherson <macpherson@chromium.org> 2 3 Inspector crashes when trying to inspect a page with CSS variables 4 https://bugs.webkit.org/show_bug.cgi?id=89818 5 6 Reviewed by Antti Koivisto. 7 8 Patch works by fixing treating handling of CSSPropertyID == CSSPropertyVariable as a special case, 9 and looking up the author-defined property name from the CSSValue. 10 11 Added test inspector/styles/variables/css-variables.html that inspects an element using CSS variables. 12 Test is skipped when variables are compiled out. 13 14 * css/CSSProperty.cpp: 15 (WebCore::CSSProperty::cssName): 16 (WebCore): 17 (WebCore::CSSProperty::cssText): 18 * css/CSSProperty.h: 19 (CSSProperty): 20 * css/PropertySetCSSStyleDeclaration.cpp: 21 (WebCore::PropertySetCSSStyleDeclaration::item): 22 * css/StylePropertySet.cpp: 23 (WebCore::StylePropertySet::asText): 24 * inspector/InspectorStyleSheet.cpp: 25 (WebCore::InspectorStyle::populateAllProperties): 26 1 27 2012-07-04 Anthony Scian <ascian@rim.com> 2 28 -
trunk/Source/WebCore/css/CSSGrammar.y
r121551 r121874 1361 1361 p->storeVariableDeclaration($1, p->sinkFloatingValueList($4), $5); 1362 1362 $$ = true; 1363 p->markPropertyEnd($5, $$);1363 p->markPropertyEnd($5, true); 1364 1364 #else 1365 1365 $$ = false; -
trunk/Source/WebCore/css/CSSParser.cpp
r121764 r121874 3013 3013 void CSSParser::storeVariableDeclaration(const CSSParserString& name, PassOwnPtr<CSSParserValueList> value, bool important) 3014 3014 { 3015 ASSERT(name.length > 12); 3016 AtomicString variableName = String(name.characters + 12, name.length - 12); 3017 3015 3018 StringBuilder builder; 3016 3019 for (unsigned i = 0, size = value->size(); i < size; i++) { … … 3019 3022 builder.append(value->valueAt(i)->createCSSValue()->cssText()); 3020 3023 } 3021 addProperty(CSSPropertyVariable, CSSVariableValue::create( name, builder.toString()), important, false);3024 addProperty(CSSPropertyVariable, CSSVariableValue::create(variableName, builder.toString()), important, false); 3022 3025 } 3023 3026 #endif … … 8982 8985 8983 8986 case CharacterDash: 8984 #if ENABLE(CSS_VARIABLES)8985 if (cssVariablesEnabled() && isEqualToCSSIdentifier(m_currentCharacter, "webkit-var") && m_currentCharacter[10] == '-' && isIdentifierStartAfterDash(m_currentCharacter + 11)) {8986 // handle variable declarations8987 m_currentCharacter += 11;8988 parseIdentifier(result, hasEscape);8989 m_token = VAR_DEFINITION;8990 yylval->string.characters = m_tokenStart;8991 yylval->string.length = result - m_tokenStart;8992 } else8993 #endif8994 8987 if (isIdentifierStartAfterDash(m_currentCharacter)) { 8995 8988 --m_currentCharacter; … … 8997 8990 m_token = IDENT; 8998 8991 8992 #if ENABLE(CSS_VARIABLES) 8993 if (cssVariablesEnabled() && isEqualToCSSIdentifier(m_tokenStart + 1, "webkit-var") && m_tokenStart[11] == '-' && isIdentifierStartAfterDash(m_tokenStart + 12)) 8994 m_token = VAR_DEFINITION; 8995 else 8996 #endif 8999 8997 if (*m_currentCharacter == '(') { 9000 8998 m_token = FUNCTION; -
trunk/Source/WebCore/css/CSSProperty.cpp
r121442 r121874 27 27 #include "StylePropertyShorthand.h" 28 28 29 #if ENABLE(CSS_VARIABLES) 30 #include "CSSVariableValue.h" 31 #endif 32 29 33 namespace WebCore { 30 34 … … 36 40 COMPILE_ASSERT(sizeof(CSSProperty) == sizeof(SameSizeAsCSSProperty), CSSProperty_should_stay_small); 37 41 42 String CSSProperty::cssName() const 43 { 44 #if ENABLE(CSS_VARIABLES) 45 if (id() == CSSPropertyVariable) { 46 ASSERT(value()->isVariableValue()); 47 return "-webkit-var-" + static_cast<CSSVariableValue*>(value())->name(); 48 } 49 #endif 50 return String(getPropertyName(id())); 51 } 52 38 53 String CSSProperty::cssText() const 39 54 { 40 return String(getPropertyName(id())) + ": " + m_value->cssText() + (isImportant() ? " !important" : "") + "; ";55 return cssName() + ": " + m_value->cssText() + (isImportant() ? " !important" : "") + "; "; 41 56 } 42 57 -
trunk/Source/WebCore/css/CSSProperty.h
r118712 r121874 52 52 CSSValue* value() const { return m_value.get(); } 53 53 54 String cssName() const; 54 55 String cssText() const; 55 56 -
trunk/Source/WebCore/css/PropertySetCSSStyleDeclaration.cpp
r121570 r121874 140 140 if (i >= m_propertySet->propertyCount()) 141 141 return ""; 142 return getPropertyName(m_propertySet->propertyAt(i).id());142 return m_propertySet->propertyAt(i).cssName(); 143 143 } 144 144 -
trunk/Source/WebCore/css/StylePropertySet.cpp
r121570 r121874 663 663 664 664 switch (propertyID) { 665 #if ENABLE(CSS_VARIABLES) 666 case CSSPropertyVariable: 667 result.append(prop.cssText()); 668 continue; 669 #endif 665 670 case CSSPropertyBackgroundPositionX: 666 671 positionXProp = ∝ -
trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp
r121551 r121874 1117 1117 1118 1118 RefPtr<StyleSheetContents> newStyleSheet = StyleSheetContents::create(); 1119 CSSParser p( CSSStrictMode);1119 CSSParser p(m_pageStyleSheet->ownerDocument()); 1120 1120 OwnPtr<RuleSourceDataList> ruleSourceDataResult = adoptPtr(new RuleSourceDataList()); 1121 1121 p.parseSheet(newStyleSheet.get(), m_parsedStyleSheet->text(), 0, ruleSourceDataResult.get()); -
trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit.py
r121497 r121874 299 299 "WebGLShader": ["fast/canvas/webgl", "compositing/webgl", "http/tests/canvas/webgl"], 300 300 "MHTMLArchive": ["mhtml"], 301 "CSSVariableValue": ["fast/css/variables" ],301 "CSSVariableValue": ["fast/css/variables", "inspector/styles/variables"], 302 302 } 303 303 -
trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit_unittest.py
r121497 r121874 101 101 "mhtml", # Requires MHTMLArchive 102 102 "fast/css/variables", # Requires CSS Variables 103 "inspector/styles/variables", # Requires CSS Variables 103 104 ]) 104 105
Note: See TracChangeset
for help on using the changeset viewer.