title attribute on style & link elements should be ignored inside a shadow tree
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 3 Dec 2018 20:33:23 +0000 (20:33 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 3 Dec 2018 20:33:23 +0000 (20:33 +0000)
commit19af57e578fa1d042c525f0b35cd1b4a02d27172
tree2006a5d3374402ce11f2d469e0e8705ed5376fe0
parent97265ec300cfd6a72dcfdfd2ac82d1265c8730c4
title attribute on style & link elements should be ignored inside a shadow tree
https://bugs.webkit.org/show_bug.cgi?id=191297

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

Rebaseline the test case that's now passing.

* web-platform-tests/css/css-scoping/stylesheet-title-002-expected.txt:

Source/WebCore:

Fixed the by not setting the stylesheet's title even when the title content attribute is present
or set on SVG/HTML style and link elements inside a shadow tree.

Test: fast/shadow-dom/stylesheet-title-in-shadow-tree.html

* dom/InlineStyleSheetOwner.cpp:
(WebCore::InlineStyleSheetOwner::createSheet):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::parseAttribute):
(WebCore::HTMLLinkElement::initializeStyleSheet):
* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::parseAttribute):
* style/StyleScope.cpp:
(WebCore::Style::Scope::collectActiveStyleSheets):
* svg/SVGStyleElement.cpp:
(WebCore::SVGStyleElement::parseAttribute):

LayoutTests:

Adde a W3C-style testharness.js test for a more comprehensive testing of the title content attribute
on HTML link and style elements and SVG style element inside a shadow tree.

* TestExpectations:
* fast/shadow-dom/resources/green-div.css: Added.
* fast/shadow-dom/resources/red-div.css: Added.
* fast/shadow-dom/stylesheet-title-in-shadow-tree-expected.txt: Added.
* fast/shadow-dom/stylesheet-title-in-shadow-tree.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238812 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
LayoutTests/ChangeLog
LayoutTests/TestExpectations
LayoutTests/fast/shadow-dom/resources/green-div.css [new file with mode: 0644]
LayoutTests/fast/shadow-dom/resources/red-div.css [new file with mode: 0644]
LayoutTests/fast/shadow-dom/stylesheet-title-in-shadow-tree-expected.txt [new file with mode: 0644]
LayoutTests/fast/shadow-dom/stylesheet-title-in-shadow-tree.html [new file with mode: 0644]
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/css/css-scoping/stylesheet-title-002-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/dom/InlineStyleSheetOwner.cpp
Source/WebCore/html/HTMLLinkElement.cpp
Source/WebCore/html/HTMLStyleElement.cpp
Source/WebCore/style/StyleScope.cpp
Source/WebCore/svg/SVGStyleElement.cpp