2007-10-01 Eric Seidel <eric@webkit.org>
authoroliver <oliver@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Oct 2007 14:19:59 +0000 (14:19 +0000)
committeroliver <oliver@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Oct 2007 14:19:59 +0000 (14:19 +0000)
        Reviewed by Oliver Hunt.

        WebArchives do not embed stylesheets referenced by xml-stylesheeet
        http://bugs.webkit.org/show_bug.cgi?id=15320

        * DOM/WebDOMOperations.mm:
        (-[DOMProcessingInstruction _stylesheetURL]): needed to access [[self sheet] href]
        (-[DOMProcessingInstruction _subresourceURLs]): call and return _stylesheetURL

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@26460 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/webarchive/resources/test-xml-stylesheet.css [new file with mode: 0644]
LayoutTests/webarchive/test-xml-stylesheet-expected.txt [new file with mode: 0644]
LayoutTests/webarchive/test-xml-stylesheet.xml [new file with mode: 0644]
WebKit/ChangeLog
WebKit/DOM/WebDOMOperations.mm

index 7dda913f54b1fba23d2779709337b59799166b29..2a80a36203f82601a24cf63d9a55900be967ff3e 100644 (file)
@@ -1,3 +1,14 @@
+2007-10-01  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Oliver Hunt.
+        
+        WebArchives do not embed stylesheets referenced by xml-stylesheeet
+        http://bugs.webkit.org/show_bug.cgi?id=15320
+
+        * webarchive/resources/test-xml-stylesheet.css: Added.
+        * webarchive/test-xml-stylesheet-expected.txt: Added.
+        * webarchive/test-xml-stylesheet.xml: Added.
+
 2007-09-30  Julien  <julien.chaffraix@gmail.com>
 
         Reviewed by aroben & eseidel.
diff --git a/LayoutTests/webarchive/resources/test-xml-stylesheet.css b/LayoutTests/webarchive/resources/test-xml-stylesheet.css
new file mode 100644 (file)
index 0000000..836cb88
--- /dev/null
@@ -0,0 +1,3 @@
+#test {
+  background: green;
+}
diff --git a/LayoutTests/webarchive/test-xml-stylesheet-expected.txt b/LayoutTests/webarchive/test-xml-stylesheet-expected.txt
new file mode 100644 (file)
index 0000000..8e62e8e
--- /dev/null
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+       <key>WebMainResource</key>
+       <dict>
+               <key>WebResourceData</key>
+               <data>
+               PD94bWwtc3R5bGVzaGVldCBocmVmPSJyZXNvdXJjZXMvdGVzdC14bWwtc3R5
+               bGVzaGVldC5jc3MiIHR5cGU9InRleHQvY3NzIj8+PGh0bWwgeG1sbnM9Imh0
+               dHA6Ly93d3cudzMub3JnLzE5OTkveGh0bWwiPgogIDxzY3JpcHQ+CiAgICBp
+               ZiAod2luZG93LmxheW91dFRlc3RDb250cm9sbGVyKQogICAgICAgIGxheW91
+               dFRlc3RDb250cm9sbGVyLmR1bXBET01Bc1dlYkFyY2hpdmUoKTsKICA8L3Nj
+               cmlwdD4KICA8c3R5bGU+CiAgICBkaXYgeyBiYWNrZ3JvdW5kOiByZWQ7IHdp
+               ZHRoOiAxMDBweDsgaGVpZ2h0OiAxMDBweDsgfQogIDwvc3R5bGU+CiAgPGRp
+               diBpZD0idGVzdCI+CiAgPC9kaXY+CjwvaHRtbD4=
+               </data>
+               <key>WebResourceFrameName</key>
+               <string></string>
+               <key>WebResourceMIMEType</key>
+               <string>application/xml</string>
+               <key>WebResourceTextEncodingName</key>
+               <string>UTF-8</string>
+               <key>WebResourceURL</key>
+               <string>file:///LayoutTests/webarchive/test-xml-stylesheet.xml</string>
+       </dict>
+       <key>WebSubresources</key>
+       <array>
+               <dict>
+                       <key>WebResourceData</key>
+                       <string>#test {
+  background: green;
+}
+</string>
+                       <key>WebResourceMIMEType</key>
+                       <string>text/css</string>
+                       <key>WebResourceResponse</key>
+                       <data>
+                       YnBsaXN0MDDUAQIDBAUGBwpZJGFyY2hpdmVyWCR2ZXJzaW9uVCR0
+                       b3BYJG9iamVjdHNfEA9OU0tleWVkQXJjaGl2ZXISAAGGoNEICV8Q
+                       E1dlYlJlc291cmNlUmVzcG9uc2WAAaQLDBscVSRudWxs1w0ODxAR
+                       EhMUFRYXGBkVUiQyUiQzUiQ0UiQwViRjbGFzc1IkNVIkMYACgAAQ
+                       HxAHgAMjf+////////+AAFh0ZXh0L2Nzc9IdHh8gWCRjbGFzc2Vz
+                       WiRjbGFzc25hbWWiICFdTlNVUkxSZXNwb25zZVhOU09iamVjdAgR
+                       GyQpMkRJTGJkaW9+gYSHipGUl5mbnZ+hqqy1usPO0d8AAAAAAAAB
+                       AQAAAAAAAAAiAAAAAAAAAAAAAAAAAAAA6A==
+                       </data>
+                       <key>WebResourceURL</key>
+                       <string>file:///LayoutTests/webarchive/resources/test-xml-stylesheet.css</string>
+               </dict>
+       </array>
+</dict>
+</plist>
diff --git a/LayoutTests/webarchive/test-xml-stylesheet.xml b/LayoutTests/webarchive/test-xml-stylesheet.xml
new file mode 100644 (file)
index 0000000..4cc54a2
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml-stylesheet href="resources/test-xml-stylesheet.css" type="text/css"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <script>
+    if (window.layoutTestController)
+        layoutTestController.dumpDOMAsWebArchive();
+  </script>
+  <style>
+    div { background: red; width: 100px; height: 100px; }
+  </style>
+  <div id="test">
+  </div>
+</html>
index 57862b2e6dabad674f960c0151bc0556ac64d5da..22b8a6381afa39268e9e6b0c96809092f7ed2baa 100644 (file)
@@ -1,3 +1,14 @@
+2007-10-01  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Oliver Hunt.
+        
+        WebArchives do not embed stylesheets referenced by xml-stylesheeet
+        http://bugs.webkit.org/show_bug.cgi?id=15320
+
+        * DOM/WebDOMOperations.mm:
+        (-[DOMProcessingInstruction _stylesheetURL]): needed to access [[self sheet] href]
+        (-[DOMProcessingInstruction _subresourceURLs]): call and return _stylesheetURL
+
 2007-10-01  Eric Seidel  <eric@webkit.org>
 
         Reviewed by Oliver Hunt.
index 37a96b16a6aa56a965102ac58db637151d7092eb..6ed465090e17e27ccdbf9f1a87608ef89fbe0f75 100644 (file)
 
 #endif
 
+@implementation DOMProcessingInstruction (WebDOMProcessingInstructionOperationsPrivate)
+
+- (NSString *)_stylesheetURL
+{
+    DOMStyleSheet *styleSheet = [self sheet];
+    if (styleSheet)
+        return [styleSheet href];
+    return nil;
+}
+
+- (NSArray *)_subresourceURLs
+{
+    return [self _URLsFromSelectors:@selector(_stylesheetURL), nil];
+}
+
+@end
+
 @implementation DOMHTMLEmbedElement (WebDOMHTMLEmbedElementOperationsPrivate)
 
 - (NSArray *)_subresourceURLs