https://bugs.webkit.org/show_bug.cgi?id=77549
Patch by Dave Tharp <dtharp@codeaurora.org> on 2012-03-13
Reviewed by David Hyatt.
Source/WebCore:
Amended code to ignore alternate stylesheets that do not have a title attribute.
Test: fast/css/xml-stylesheet-alternate-no-title.xhtml
* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::checkStyleSheet):
LayoutTests:
Added new text test, modified existing test: added title attribute to alternate stylesheet.
* fast/css/xml-stylesheet-alternate-no-title-expected.txt: Added.
* fast/css/xml-stylesheet-alternate-no-title.xhtml: Added.
* fast/css/xml-stylesheet-alternate-processing.xhtml:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@110632
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-03-13 Dave Tharp <dtharp@codeaurora.org>
+
+ Alternate xml-stylesheets with no title are loaded, in violation of the CSSOM draft
+ https://bugs.webkit.org/show_bug.cgi?id=77549
+
+ Reviewed by David Hyatt.
+
+ Added new text test, modified existing test: added title attribute to alternate stylesheet.
+
+ * fast/css/xml-stylesheet-alternate-no-title-expected.txt: Added.
+ * fast/css/xml-stylesheet-alternate-no-title.xhtml: Added.
+ * fast/css/xml-stylesheet-alternate-processing.xhtml:
+
2012-03-13 Alexey Proskuryakov <ap@apple.com>
Adding missing results.
--- /dev/null
+xml alternate stylesheet with no title test
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+PASS getComputedStyle(element).getPropertyValue('color') is 'rgb(0, 128, 0)'
+This text should be green
--- /dev/null
+<?xml-stylesheet type="text/css" href="data:text/css,root { color: green; }"?>
+<?xml-stylesheet alternate="yes" type="text/css" href="data:text/css,root { color: red; }"?>
+<!DOCTYPE html>
+<root xmlns="http://www.w3.org/1999/xhtml" >
+ <head>
+ <meta charset="utf-8"/>
+ <script src="../js/resources/js-test-pre.js"></script>
+ <script>
+
+ description("xml alternate stylesheet with no title test");
+
+ window.onload = function() {
+
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+ if (document.styleSheets.length > 1)
+ document.styleSheets[1].disabled = false;
+
+ element = document.getElementById("sampleText") ;
+ shouldBe("getComputedStyle(element).getPropertyValue('color')", "'rgb(0, 128, 0)'");
+ }
+
+ </script>
+ </head>
+
+ <body>
+ <div id="sampleText">This text should be green</div>
+
+ <script src="../js/resources/js-test-post.js"></script>
+ </body>
+</root>
<?xml version="1.0" encoding="UTF-8"?>
-<?xml-stylesheet href="resources/xml-stylesheet-pi-not-in-prolog.css" type="text/css" alternate="yes"?>
+<?xml-stylesheet href="resources/xml-stylesheet-pi-not-in-prolog.css" type="text/css" alternate="yes" title="alt1"?>
<?xml-stylesheet href="resources/xml-stylesheet-pi-not-in-prolog.css" type="text/css" alternate="no"?>
<?xml-stylesheet href="resources/xml-stylesheet-pi-not-in-prolog.css" type="text/css"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+2012-03-13 Dave Tharp <dtharp@codeaurora.org>
+
+ Alternate xml-stylesheets with no title are loaded, in violation of the CSSOM draft
+ https://bugs.webkit.org/show_bug.cgi?id=77549
+
+ Reviewed by David Hyatt.
+
+ Amended code to ignore alternate stylesheets that do not have a title attribute.
+
+ Test: fast/css/xml-stylesheet-alternate-no-title.xhtml
+
+ * dom/ProcessingInstruction.cpp:
+ (WebCore::ProcessingInstruction::checkStyleSheet):
+
2012-03-13 Levi Weintraub <leviw@chromium.org>
Revert RenderLayer::absoluteBoundingBox to an IntRect
m_title = attrs.get("title");
m_media = attrs.get("media");
+ if (m_alternate && m_title.isEmpty())
+ return;
+
if (href.length() > 1 && href[0] == '#') {
m_localHref = href.substring(1);
#if ENABLE(XSLT)