haikuwebkit/LayoutTests/fast/shadow-dom/computed-style-display-none...

11 lines
275 B
Plaintext
Raw Permalink Normal View History

Computed style should work correctly with slotted elements that have display:none https://bugs.webkit.org/show_bug.cgi?id=150237 Source/WebCore: Reviewed by Andreas Kling.. If an element has display:none we don't normally retain or even compute its style (as it is not rendered). If getComputedStyle is invoked for such element we resolve the style (along with any ancestors) and cache it separately to rare data. This path needs to work with slotted elements in shadow trees. This patch also make computedStyle() iterative rather than recursive. Test: fast/shadow-dom/computed-style-display-none.html * dom/Document.cpp: (WebCore::Document::styleForElementIgnoringPendingStylesheets): Pass in the parent style instead of invoking computedStyle() recursively. * dom/Document.h: * dom/Element.cpp: (WebCore::beforeOrAfterPseudoElement): (WebCore::Element::existingComputedStyle): (WebCore::Element::resolveComputedStyle): Iterative resolve function that uses composed tree iterator. (WebCore::Element::computedStyle): Factor into helpers. * dom/Element.h: * dom/Node.cpp: (WebCore::Node::computedStyle): Use the composed tree iterator. * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::selectOption): Call updateValidity() before calling renderer->updateFromElement(). Calling updateFromElement() may end up in Element::computedStyle() which can asserts if validity is not up to date. LayoutTests: Reviewed by Andreas Kling. * editing/style/apply-style-atomic-expected.txt: Rebase. * fast/css/getComputedStyle/getComputedStyle-with-pseudo-element-expected.txt: * fast/css/getComputedStyle/getComputedStyle-with-pseudo-element.html: We now also compute style of display:none pseudo elements correctly. This is a progression and matches other browsers. * fast/shadow-dom/computed-style-display-none-expected.txt: Added. * fast/shadow-dom/computed-style-display-none.html: Added. Canonical link: https://commits.webkit.org/168432@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191262 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-10-18 22:15:18 +00:00
Ensure tha slotted elements with display:none inherit their style via shadow tree
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS getComputedStyle(hostChild).color is "rgb(0, 128, 0)"
PASS successfullyParsed is true
TEST COMPLETE