Title: [136105] trunk
Revision
136105
Author
[email protected]
Date
2012-11-28 23:46:01 -0800 (Wed, 28 Nov 2012)

Log Message

Add a test to ensure that 'seamless' iframes do not inherit contenteditable.
https://bugs.webkit.org/show_bug.cgi?id=95890

Reviewed by Ojan Vafai.

Source/WebCore:

We don't currently support inheriting contenteditable into a seamless
frame. http://html5.org/tools/web-apps-tracker?from=7318&to=7319
brought the spec in line with WebKit's behavior (ha!). This patch
defends the behavior by adding a test, and removes a FIXME comment
now that the question is settled.

It also exposes a brand new bug: https://bugs.webkit.org/show_bug.cgi?id=103539
How exciting.

Test: fast/frames/seamless/seamless-contenteditable-not-inherited.html

* css/StyleResolver.cpp:
(WebCore::StyleResolver::styleForDocument):
    No functional change, just dropping a FIXME comment.

LayoutTests:

* fast/frames/seamless/seamless-contenteditable-not-inherited-expected.txt: Added.
* fast/frames/seamless/seamless-contenteditable-not-inherited.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (136104 => 136105)


--- trunk/LayoutTests/ChangeLog	2012-11-29 07:28:02 UTC (rev 136104)
+++ trunk/LayoutTests/ChangeLog	2012-11-29 07:46:01 UTC (rev 136105)
@@ -1,5 +1,15 @@
 2012-11-28  Mike West  <[email protected]>
 
+        Add a test to ensure that 'seamless' iframes do not inherit contenteditable.
+        https://bugs.webkit.org/show_bug.cgi?id=95890
+
+        Reviewed by Ojan Vafai.
+
+        * fast/frames/seamless/seamless-contenteditable-not-inherited-expected.txt: Added.
+        * fast/frames/seamless/seamless-contenteditable-not-inherited.html: Added.
+
+2012-11-28  Mike West  <[email protected]>
+
         Web Inspector: Console message's anchor element should be trimmed for readability.
         https://bugs.webkit.org/show_bug.cgi?id=100095
 

Added: trunk/LayoutTests/fast/frames/seamless/seamless-contenteditable-not-inherited-expected.txt (0 => 136105)


--- trunk/LayoutTests/fast/frames/seamless/seamless-contenteditable-not-inherited-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/frames/seamless/seamless-contenteditable-not-inherited-expected.txt	2012-11-29 07:46:01 UTC (rev 136105)
@@ -0,0 +1,4 @@
+This test ensures that content inside a seamless iframe does not inherit editability via the contenteditable attribute on a parent element, but does via a CSS rule that cascades into the frame.
+PASS window.getComputedStyle(span).getPropertyCSSValue('-webkit-user-modify').cssText is "read-only"
+FAIL window.getComputedStyle(p).getPropertyCSSValue('-webkit-user-modify').cssText should be read-write. Was read-only.
+

Added: trunk/LayoutTests/fast/frames/seamless/seamless-contenteditable-not-inherited.html (0 => 136105)


--- trunk/LayoutTests/fast/frames/seamless/seamless-contenteditable-not-inherited.html	                        (rev 0)
+++ trunk/LayoutTests/fast/frames/seamless/seamless-contenteditable-not-inherited.html	2012-11-29 07:46:01 UTC (rev 136105)
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <script src=""
+    <script>
+        window._onload_ = function () {
+            debug("This test ensures that content inside a seamless iframe does not inherit editability via the contenteditable attribute on a parent element, but does via a CSS rule that cascades into the frame.");
+
+            window.span = document.querySelector('div > iframe').contentDocument.querySelector('span');
+            window.p = document.querySelector('body > iframe').contentDocument.querySelector('p');
+
+            shouldBeEqualToString("window.getComputedStyle(span).getPropertyCSSValue('-webkit-user-modify').cssText", "read-only");
+            shouldBeEqualToString("window.getComputedStyle(p).getPropertyCSSValue('-webkit-user-modify').cssText", "read-write");
+        };
+    </script>
+</head>
+<body>
+    <div contenteditable>
+        <iframe seamless srcdoc="<span>This span is not editable.</span>"></iframe>
+    </div>
+    <style>
+        p { -webkit-user-modify: read-write; }
+    </style>
+    <iframe seamless srcdoc="<p>This paragraph is not editable.</p>"></iframe>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (136104 => 136105)


--- trunk/Source/WebCore/ChangeLog	2012-11-29 07:28:02 UTC (rev 136104)
+++ trunk/Source/WebCore/ChangeLog	2012-11-29 07:46:01 UTC (rev 136105)
@@ -1,5 +1,27 @@
 2012-11-28  Mike West  <[email protected]>
 
+        Add a test to ensure that 'seamless' iframes do not inherit contenteditable.
+        https://bugs.webkit.org/show_bug.cgi?id=95890
+
+        Reviewed by Ojan Vafai.
+
+        We don't currently support inheriting contenteditable into a seamless
+        frame. http://html5.org/tools/web-apps-tracker?from=7318&to=7319
+        brought the spec in line with WebKit's behavior (ha!). This patch
+        defends the behavior by adding a test, and removes a FIXME comment
+        now that the question is settled.
+
+        It also exposes a brand new bug: https://bugs.webkit.org/show_bug.cgi?id=103539
+        How exciting.
+
+        Test: fast/frames/seamless/seamless-contenteditable-not-inherited.html
+
+        * css/StyleResolver.cpp:
+        (WebCore::StyleResolver::styleForDocument):
+            No functional change, just dropping a FIXME comment.
+
+2012-11-28  Mike West  <[email protected]>
+
         Web Inspector: Console message's anchor element should be trimmed for readability.
         https://bugs.webkit.org/show_bug.cgi?id=100095
 

Modified: trunk/Source/WebCore/css/StyleResolver.cpp (136104 => 136105)


--- trunk/Source/WebCore/css/StyleResolver.cpp	2012-11-29 07:28:02 UTC (rev 136104)
+++ trunk/Source/WebCore/css/StyleResolver.cpp	2012-11-29 07:46:01 UTC (rev 136105)
@@ -1398,7 +1398,7 @@
         documentStyle->setPageScaleTransform(frame ? frame->frameScaleFactor() : 1);
         documentStyle->setLocale(document->contentLanguage());
     }
-    // FIXME: This overrides any -webkit-user-modify inherited from the parent iframe.
+    // This overrides any -webkit-user-modify inherited from the parent iframe.
     documentStyle->setUserModify(document->inDesignMode() ? READ_WRITE : READ_ONLY);
 
     Element* docElement = document->documentElement();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to