Changeset 221542 in webkit
- Timestamp:
- Sep 2, 2017 7:31:13 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/fast/css/getComputedStyle/getComputedStyle-with-pseudo-element-expected.txt
r191262 r221542 64 64 PASS Expected '100px' for height in the computed style for element with id testNoPseudoElement and pseudo-element null and got '100px' 65 65 PASS Expected '100px' for width in the computed style for element with id testNoPseudoElement and pseudo-element null and got '100px' 66 PASS Expected ' 100px' for height in the computed style for element with id testNoPseudoElement and pseudo-element :after and got '100px'67 PASS Expected ' 100px' for width in the computed style for element with id testNoPseudoElement and pseudo-element :after and got '100px'66 PASS Expected 'auto' for height in the computed style for element with id testNoPseudoElement and pseudo-element :after and got 'auto' 67 PASS Expected 'auto' for width in the computed style for element with id testNoPseudoElement and pseudo-element :after and got 'auto' 68 68 PASS Expected '0.5' for opacity in the computed style for element with id testHardwareAcceleratedCompositing and pseudo-element :before and got '0.5' -
trunk/LayoutTests/fast/css/getComputedStyle/getComputedStyle-with-pseudo-element.html
r191262 r221542 181 181 { 'elementId' : 'testNoPseudoElement', 'pseudoElement' : null, 'property' : 'height', 'expectedValue' : '100px' }, 182 182 { 'elementId' : 'testNoPseudoElement', 'pseudoElement' : null, 'property' : 'width', 'expectedValue' : '100px' }, 183 { 'elementId' : 'testNoPseudoElement', 'pseudoElement' : ':after', 'property' : 'height', 'expectedValue' : ' 100px' },184 { 'elementId' : 'testNoPseudoElement', 'pseudoElement' : ':after', 'property' : 'width', 'expectedValue' : ' 100px' },183 { 'elementId' : 'testNoPseudoElement', 'pseudoElement' : ':after', 'property' : 'height', 'expectedValue' : 'auto' }, 184 { 'elementId' : 'testNoPseudoElement', 'pseudoElement' : ':after', 'property' : 'width', 'expectedValue' : 'auto' }, 185 185 { 'elementId' : 'testHardwareAcceleratedCompositing', 'pseudoElement' : ':before', 'property' : 'opacity', 'expectedValue' : '0.5' } 186 186 ]; -
trunk/LayoutTests/imported/w3c/ChangeLog
r221512 r221542 1 2017-09-02 Emilio Cobos Álvarez <emilio@crisal.io> 2 3 Wrong getComputedStyle result for pseudo-elements in display: none subtrees. 4 https://bugs.webkit.org/show_bug.cgi?id=176259 5 6 Reviewed by Antti Koivisto. 7 8 * web-platform-tests/cssom/getComputedStyle-pseudo-expected.txt: 9 1 10 2017-09-01 Sam Weinig <sam@webkit.org> 2 11 -
trunk/LayoutTests/imported/w3c/web-platform-tests/cssom/getComputedStyle-pseudo-expected.txt
r221501 r221542 1 1 2 2 PASS Resolution of width is correct for ::before and ::after pseudo-elements 3 FAIL Resolution of width is correct for ::before and ::after pseudo-elements of display: contents elements assert_equals: expected "50px" but got " auto"4 FAIL Resolution of nonexistent pseudo-element styles assert_equals: Nonexistent :before pseudo-element shouldn't claim to have the same style as the originating element expected "static" but got "relative" 5 FAIL Resolution of pseudo-element styles in display: none elements assert_equals: Pseudo-styles of display: none elements should be correct expected "\"Foo\"" but got " "3 FAIL Resolution of width is correct for ::before and ::after pseudo-elements of display: contents elements assert_equals: expected "50px" but got "50%" 4 PASS Resolution of nonexistent pseudo-element styles 5 FAIL Resolution of pseudo-element styles in display: none elements assert_equals: Pseudo-styles of display: none elements should be correct expected "\"Foo\"" but got "Foo" 6 6 -
trunk/Source/WebCore/ChangeLog
r221540 r221542 1 2017-09-02 Emilio Cobos Álvarez <emilio@crisal.io> 2 3 Wrong getComputedStyle result for pseudo-elements in display: none subtrees. 4 https://bugs.webkit.org/show_bug.cgi?id=176259 5 6 Reviewed by Antti Koivisto. 7 8 Before this patch, we were wrongly returning the parent style when there wasn't 9 a cached pseudo style. 10 11 With this, the only remaining failures in getComputedStyle-pseudo is a 12 serialisation bug for the "content" property, and the display: contents test, 13 which is because we don't support pseudo-elements of display: contents elements 14 yet. 15 16 Tests: imported/w3c/web-platform-tests/cssom/getComputedStyle-pseudo.html 17 18 * dom/Document.cpp: 19 (WebCore::Document::styleForElementIgnoringPendingStylesheets): 20 * dom/Document.h: 21 * dom/Element.cpp: 22 (WebCore::Element::resolvePseudoElementStyle): 23 (WebCore::Element::computedStyle): 24 * dom/Element.h: 25 1 26 2017-09-02 Chris Dumez <cdumez@apple.com> 2 27 -
trunk/Source/WebCore/dom/Document.cpp
r221494 r221542 1950 1950 } 1951 1951 1952 std::unique_ptr<RenderStyle> Document::styleForElementIgnoringPendingStylesheets(Element& element, const RenderStyle* parentStyle )1952 std::unique_ptr<RenderStyle> Document::styleForElementIgnoringPendingStylesheets(Element& element, const RenderStyle* parentStyle, PseudoId pseudoElementSpecifier) 1953 1953 { 1954 1954 ASSERT(&element.document() == this); 1955 ASSERT(!element.isPseudoElement() || !pseudoElementSpecifier); 1956 ASSERT(!pseudoElementSpecifier || parentStyle); 1955 1957 1956 1958 // On iOS request delegates called during styleForElement may result in re-entering WebKit and killing the style resolver. … … 1958 1960 1959 1961 SetForScope<bool> change(m_ignorePendingStylesheets, true); 1960 auto elementStyle = element.resolveStyle(parentStyle); 1961 1962 auto& resolver = element.styleResolver(); 1963 1964 if (pseudoElementSpecifier) 1965 return resolver.pseudoStyleForElement(element, PseudoStyleRequest(pseudoElementSpecifier), *parentStyle); 1966 1967 auto elementStyle = resolver.styleForElement(element, parentStyle); 1962 1968 if (elementStyle.relations) { 1963 1969 Style::Update emptyUpdate(*this); -
trunk/Source/WebCore/dom/Document.h
r221494 r221542 563 563 WEBCORE_EXPORT void updateLayoutIgnorePendingStylesheets(RunPostLayoutTasks = RunPostLayoutTasks::Asynchronously); 564 564 565 std::unique_ptr<RenderStyle> styleForElementIgnoringPendingStylesheets(Element&, const RenderStyle* parentStyle );565 std::unique_ptr<RenderStyle> styleForElementIgnoringPendingStylesheets(Element&, const RenderStyle* parentStyle, PseudoId = NOPSEUDO); 566 566 567 567 // Returns true if page box (margin boxes and page borders) is visible. -
trunk/Source/WebCore/dom/Element.cpp
r221464 r221542 2740 2740 } 2741 2741 2742 const RenderStyle& Element::resolvePseudoElementStyle(PseudoId pseudoElementSpecifier) 2743 { 2744 ASSERT(!isPseudoElement()); 2745 2746 auto* parentStyle = existingComputedStyle(); 2747 ASSERT(parentStyle); 2748 ASSERT(!parentStyle->getCachedPseudoStyle(pseudoElementSpecifier)); 2749 2750 auto style = document().styleForElementIgnoringPendingStylesheets(*this, parentStyle, pseudoElementSpecifier); 2751 if (!style) { 2752 style = RenderStyle::createPtr(); 2753 style->inheritFrom(*parentStyle); 2754 style->setStyleType(pseudoElementSpecifier); 2755 } 2756 2757 auto* computedStyle = style.get(); 2758 const_cast<RenderStyle*>(parentStyle)->addCachedPseudoStyle(WTFMove(style)); 2759 return *computedStyle; 2760 } 2761 2742 2762 const RenderStyle* Element::computedStyle(PseudoId pseudoElementSpecifier) 2743 2763 { … … 2755 2775 if (auto* cachedPseudoStyle = style->getCachedPseudoStyle(pseudoElementSpecifier)) 2756 2776 return cachedPseudoStyle; 2777 return &resolvePseudoElementStyle(pseudoElementSpecifier); 2757 2778 } 2758 2779 -
trunk/Source/WebCore/dom/Element.h
r221464 r221542 647 647 648 648 const RenderStyle& resolveComputedStyle(); 649 const RenderStyle& resolvePseudoElementStyle(PseudoId); 649 650 650 651 bool rareDataStyleAffectedByEmpty() const;
Note: See TracChangeset
for help on using the changeset viewer.