Crash on display-contents-replaced-001.html
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 May 2017 08:35:40 +0000 (08:35 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 May 2017 08:35:40 +0000 (08:35 +0000)
commit29b2ccb2d84f1782319be43ae5fab03df7c81a44
tree513e14b836e7584fe95a5f1ced4c713e1dcf2f40
parent22780b71b17bc637297cbe2e1c91c85a669d2967
Crash on display-contents-replaced-001.html
https://bugs.webkit.org/show_bug.cgi?id=172596

Reviewed by Andreas Kling.

Source/WebCore:

This is crashing because some code can't handle display:contents on form controls. Turns
out the draft specification tell us to disable it for them in any case.

See https://drafts.csswg.org/css-display-3/#unbox

* css/StyleResolver.cpp:
(WebCore::hasEffectiveDisplayNoneForDisplayContents):

    For certain HTML elements (replaced elements, form controls) display:contents should
    behave like display:none.
    Also disable it for SVG and MathML elements.

(WebCore::StyleResolver::adjustRenderStyle):

    Also compute to display:none when there is no associated element (pseudos etc).

LayoutTests:

* TestExpectations: Enable the test.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217549 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/css/StyleResolver.cpp