Changeset 63038 in webkit
- Timestamp:
- Jul 9, 2010 9:08:32 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r63034 r63038 1 2010-07-09 Erik Arvidsson <arv@chromium.org> 2 3 Reviewed by Darin Adler. 4 5 Computed style is not implemented for padding-start, padding-end, margin-start, margin-end 6 https://bugs.webkit.org/show_bug.cgi?id=41496 7 8 * fast/css/margin-start-end-expected.txt: 9 * fast/css/padding-start-end-expected.txt: 10 * fast/css/script-tests/margin-start-end.js: Added tests for computed style. 11 * fast/css/script-tests/padding-start-end.js: Added tests for computed style. 12 1 13 2010-07-09 Daniel Bates <dbates@rim.com> 2 14 -
trunk/LayoutTests/fast/css/margin-start-end-expected.txt
r62877 r63038 8 8 PASS test("ltr", "-webkit-margin-start", "10px", "margin-left") is "10px" 9 9 PASS test("ltr", "-webkit-margin-end", "20px", "margin-right") is "20px" 10 PASS test("ltr", "margin-left", "10px", "-webkit-margin-start") is "10px" 11 PASS test("ltr", "margin-right", "20px", "-webkit-margin-end") is "20px" 10 12 PASS test("rtl", "-webkit-margin-start", "10px", "width") is "90px" 11 13 PASS test("rtl", "-webkit-margin-end", "20px", "width") is "80px" 12 14 PASS test("rtl", "-webkit-margin-start", "10px", "margin-right") is "10px" 13 15 PASS test("rtl", "-webkit-margin-end", "20px", "margin-left") is "20px" 16 PASS test("rtl", "margin-right", "10px", "-webkit-margin-start") is "10px" 17 PASS test("rtl", "margin-left", "20px", "-webkit-margin-end") is "20px" 14 18 PASS successfullyParsed is true 15 19 -
trunk/LayoutTests/fast/css/padding-start-end-expected.txt
r62877 r63038 8 8 PASS test("ltr", "-webkit-padding-start", "10px", "padding-left") is "10px" 9 9 PASS test("ltr", "-webkit-padding-end", "20px", "padding-right") is "20px" 10 PASS test("ltr", "padding-left", "10px", "-webkit-padding-start") is "10px" 11 PASS test("ltr", "padding-right", "20px", "-webkit-padding-end") is "20px" 10 12 PASS testWidth("rtl", "-webkit-padding-start", "10px") is 110 11 13 PASS testWidth("rtl", "-webkit-padding-end", "20px") is 120 12 14 PASS test("rtl", "-webkit-padding-start", "10px", "padding-right") is "10px" 13 15 PASS test("rtl", "-webkit-padding-end", "20px", "padding-left") is "20px" 16 PASS test("rtl", "padding-right", "10px", "-webkit-padding-start") is "10px" 17 PASS test("rtl", "padding-left", "20px", "-webkit-padding-end") is "20px" 14 18 PASS successfullyParsed is true 15 19 -
trunk/LayoutTests/fast/css/script-tests/margin-start-end.js
r62877 r63038 22 22 shouldBeEqualToString('test("ltr", "-webkit-margin-start", "10px", "margin-left")', '10px'); 23 23 shouldBeEqualToString('test("ltr", "-webkit-margin-end", "20px", "margin-right")', '20px'); 24 shouldBeEqualToString('test("ltr", "margin-left", "10px", "-webkit-margin-start")', '10px'); 25 shouldBeEqualToString('test("ltr", "margin-right", "20px", "-webkit-margin-end")', '20px'); 24 26 25 27 shouldBeEqualToString('test("rtl", "-webkit-margin-start", "10px", "width")', '90px'); … … 27 29 shouldBeEqualToString('test("rtl", "-webkit-margin-start", "10px", "margin-right")', '10px'); 28 30 shouldBeEqualToString('test("rtl", "-webkit-margin-end", "20px", "margin-left")', '20px'); 31 shouldBeEqualToString('test("rtl", "margin-right", "10px", "-webkit-margin-start")', '10px'); 32 shouldBeEqualToString('test("rtl", "margin-left", "20px", "-webkit-margin-end")', '20px'); 29 33 30 34 successfullyParsed = true; -
trunk/LayoutTests/fast/css/script-tests/padding-start-end.js
r62877 r63038 29 29 shouldBeEqualToString('test("ltr", "-webkit-padding-start", "10px", "padding-left")', '10px'); 30 30 shouldBeEqualToString('test("ltr", "-webkit-padding-end", "20px", "padding-right")', '20px'); 31 shouldBeEqualToString('test("ltr", "padding-left", "10px", "-webkit-padding-start")', '10px'); 32 shouldBeEqualToString('test("ltr", "padding-right", "20px", "-webkit-padding-end")', '20px'); 31 33 32 34 shouldBe('testWidth("rtl", "-webkit-padding-start", "10px")', '110'); … … 34 36 shouldBeEqualToString('test("rtl", "-webkit-padding-start", "10px", "padding-right")', '10px'); 35 37 shouldBeEqualToString('test("rtl", "-webkit-padding-end", "20px", "padding-left")', '20px'); 38 shouldBeEqualToString('test("rtl", "padding-right", "10px", "-webkit-padding-start")', '10px'); 39 shouldBeEqualToString('test("rtl", "padding-left", "20px", "-webkit-padding-end")', '20px'); 36 40 37 41 successfullyParsed = true; -
trunk/WebCore/ChangeLog
r63037 r63038 1 2010-07-09 Erik Arvidsson <arv@chromium.org> 2 3 Reviewed by Darin Adler. 4 5 Computed style is not implemented for padding-start, padding-end, margin-start, margin-end 6 https://bugs.webkit.org/show_bug.cgi?id=41496 7 8 * css/CSSComputedStyleDeclaration.cpp: 9 (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): 10 * css/CSSProperty.cpp: 11 (WebCore::CSSProperty::resolveDirectionAwareProperty): This function resolves the property ID for a direction aware property. 12 * css/CSSProperty.h: 13 * css/CSSStyleSelector.cpp: Use helper function. 14 (WebCore::CSSStyleSelector::applyProperty): 15 1 16 2010-07-09 Adam Barth <abarth@webkit.org> 2 17 -
trunk/WebCore/css/CSSComputedStyleDeclaration.cpp
r62877 r63038 683 683 if (!style) 684 684 return 0; 685 686 propertyID = CSSProperty::resolveDirectionAwareProperty(propertyID, style->direction()); 685 687 686 688 switch (static_cast<CSSPropertyID>(propertyID)) { … … 1470 1472 case CSSPropertyWebkitMaskRepeatX: 1471 1473 case CSSPropertyWebkitMaskRepeatY: 1472 case CSSPropertyWebkitPaddingEnd:1473 case CSSPropertyWebkitPaddingStart:1474 1474 case CSSPropertyWebkitPerspectiveOriginX: 1475 1475 case CSSPropertyWebkitPerspectiveOriginY: -
trunk/WebCore/css/CSSProperty.cpp
r50583 r63038 39 39 } 40 40 41 int CSSProperty::resolveDirectionAwareProperty(int propertyID, TextDirection direction) 42 { 43 switch (static_cast<CSSPropertyID>(propertyID)) { 44 case CSSPropertyWebkitMarginEnd: 45 return direction == LTR ? CSSPropertyMarginRight : CSSPropertyMarginLeft; 46 case CSSPropertyWebkitMarginStart: 47 return direction == LTR ? CSSPropertyMarginLeft : CSSPropertyMarginRight; 48 case CSSPropertyWebkitPaddingEnd: 49 return direction == LTR ? CSSPropertyPaddingRight : CSSPropertyPaddingLeft; 50 case CSSPropertyWebkitPaddingStart: 51 return direction == LTR ? CSSPropertyPaddingLeft : CSSPropertyPaddingRight; 52 default: 53 return propertyID; 54 } 55 } 56 41 57 } // namespace WebCore -
trunk/WebCore/css/CSSProperty.h
r50583 r63038 23 23 24 24 #include "CSSValue.h" 25 #include "TextDirection.h" 25 26 #include <wtf/PassRefPtr.h> 26 27 #include <wtf/RefPtr.h> … … 59 60 String cssText() const; 60 61 62 static int resolveDirectionAwareProperty(int propertyID, TextDirection); 63 61 64 friend bool operator==(const CSSProperty&, const CSSProperty&); 62 65 -
trunk/WebCore/css/CSSStyleSelector.cpp
r62877 r63038 3109 3109 bool isInitial = valueType == CSSValue::CSS_INITIAL || (!m_parentNode && valueType == CSSValue::CSS_INHERIT); 3110 3110 3111 // These properties are used to set the correct margins/padding on RTL lists. 3112 if (id == CSSPropertyWebkitMarginEnd) 3113 id = m_style->direction() == LTR ? CSSPropertyMarginRight : CSSPropertyMarginLeft; 3114 else if (id == CSSPropertyWebkitMarginStart) 3115 id = m_style->direction() == LTR ? CSSPropertyMarginLeft : CSSPropertyMarginRight; 3116 else if (id == CSSPropertyWebkitPaddingEnd) 3117 id = m_style->direction() == LTR ? CSSPropertyPaddingRight : CSSPropertyPaddingLeft; 3118 else if (id == CSSPropertyWebkitPaddingStart) 3119 id = m_style->direction() == LTR ? CSSPropertyPaddingLeft : CSSPropertyPaddingRight; 3111 id = CSSProperty::resolveDirectionAwareProperty(id, m_style->direction()); 3120 3112 3121 3113 if (m_checker.m_matchVisitedPseudoClass && !isValidVisitedLinkProperty(id)) {
Note: See TracChangeset
for help on using the changeset viewer.