Changeset 217549 in webkit
- Timestamp:
- May 30, 2017 1:35:40 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r217548 r217549 1 2017-05-29 Antti Koivisto <antti@apple.com> 2 3 Crash on display-contents-replaced-001.html 4 https://bugs.webkit.org/show_bug.cgi?id=172596 5 6 Reviewed by Andreas Kling. 7 8 * TestExpectations: Enable the test. 9 1 10 2017-05-30 Zan Dobersek <zdobersek@igalia.com> 2 11 -
trunk/LayoutTests/TestExpectations
r217536 r217549 1179 1179 webkit.org/b/157477 imported/w3c/web-platform-tests/css/css-display-3/display-contents-dynamic-list-001-none.html [ ImageOnlyFailure ] 1180 1180 1181 webkit.org/b/172596 imported/w3c/web-platform-tests/css/css-display-3/display-contents-replaced-001.html [ Skip ]1182 1183 1181 ### END OF display: contents failures 1184 1182 ######################################## -
trunk/Source/WebCore/ChangeLog
r217548 r217549 1 2017-05-29 Antti Koivisto <antti@apple.com> 2 3 Crash on display-contents-replaced-001.html 4 https://bugs.webkit.org/show_bug.cgi?id=172596 5 6 Reviewed by Andreas Kling. 7 8 This is crashing because some code can't handle display:contents on form controls. Turns 9 out the draft specification tell us to disable it for them in any case. 10 11 See https://drafts.csswg.org/css-display-3/#unbox 12 13 * css/StyleResolver.cpp: 14 (WebCore::hasEffectiveDisplayNoneForDisplayContents): 15 16 For certain HTML elements (replaced elements, form controls) display:contents should 17 behave like display:none. 18 Also disable it for SVG and MathML elements. 19 20 (WebCore::StyleResolver::adjustRenderStyle): 21 22 Also compute to display:none when there is no associated element (pseudos etc). 23 1 24 2017-05-30 Zan Dobersek <zdobersek@igalia.com> 2 25 -
trunk/Source/WebCore/css/StyleResolver.cpp
r217536 r217549 88 88 #include "LinkHash.h" 89 89 #include "LocaleToScriptMapping.h" 90 #include "MathMLElement.h" 90 91 #include "MathMLNames.h" 91 92 #include "MediaList.h" … … 785 786 } 786 787 788 static bool hasEffectiveDisplayNoneForDisplayContents(const Element& element) 789 { 790 // https://drafts.csswg.org/css-display-3/#unbox-html 791 static NeverDestroyed<HashSet<AtomicString>> tagNames = [] { 792 static const HTMLQualifiedName* const tagList[] = { 793 &brTag, 794 &wbrTag, 795 &meterTag, 796 &appletTag, 797 &progressTag, 798 &canvasTag, 799 &embedTag, 800 &objectTag, 801 &audioTag, 802 &iframeTag, 803 &imgTag, 804 &videoTag, 805 &frameTag, 806 &framesetTag, 807 &inputTag, 808 &textareaTag, 809 &selectTag, 810 }; 811 HashSet<AtomicString> set; 812 for (auto& name : tagList) 813 set.add(name->localName()); 814 return set; 815 }(); 816 817 // https://drafts.csswg.org/css-display-3/#unbox-svg 818 // FIXME: <g>, <use> and <tspan> have special (?) behavior for display:contents in the current draft spec. 819 if (is<SVGElement>(element)) 820 return true; 821 // Not sure MathML code can handle it. 822 if (is<MathMLElement>(element)) 823 return true; 824 if (!is<HTMLElement>(element)) 825 return false; 826 return tagNames.get().contains(element.localName()); 827 } 828 787 829 void StyleResolver::adjustRenderStyle(RenderStyle& style, const RenderStyle& parentStyle, const RenderStyle* parentBoxStyle, const Element* element) 788 830 { … … 796 838 797 839 if (style.display() == CONTENTS) { 798 // FIXME: Enable for all elements.799 840 bool elementSupportsDisplayContents = is<HTMLSlotElement>(element) || RuntimeEnabledFeatures::sharedFeatures().displayContentsEnabled(); 800 841 if (!elementSupportsDisplayContents) 801 842 style.setDisplay(INLINE); 843 else if (!element || hasEffectiveDisplayNoneForDisplayContents(*element)) 844 style.setDisplay(NONE); 802 845 } 803 846
Note: See TracChangeset
for help on using the changeset viewer.