WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-90661-20120815161516.patch (text/plain), 8.19 KB, created by
Takashi Sakamoto
on 2012-08-15 00:15:49 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Takashi Sakamoto
Created:
2012-08-15 00:15:49 PDT
Size:
8.19 KB
patch
obsolete
>Subversion Revision: 125651 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index dbd6f96947768fc570370af3f59f7ae856a064d8..6fa70627de1c408ecde15971539ad4e7c4473948 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,28 @@ >+2012-07-06 Takashi Sakamoto <tasak@google.com> >+ >+ [Shadow] distribute nodes don't inherit styles from parentNodeForRenderingAndStyle. >+ https://bugs.webkit.org/show_bug.cgi?id=90661 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ styleForElement tries to use previous sibling's style for distributed >+ nodes. However distributed nodes are children of a shadow host, but >+ the nodes are not siblings as the result of distribution. >+ The spec is: >+ http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#shadow-dom-subtrees >+ So sharing previous sibling's style should be disabled for distrbuted >+ nodes. >+ >+ Test: fast/dom/shadow/style-of-distributed-node.html >+ >+ * css/StyleResolver.cpp: >+ (WebCore::isDistributedToInsertionPoint): >+ Newly added. An inline static function to find whether the given >+ element is distributed to an insertion point. >+ (WebCore::StyleResolver::styleForElement): >+ Modify the condition whether to check shared styles or not. If the given >+ element is distributed, now StyleResolver doesn't check shared styles. >+ > 2012-08-14 Jan Keromnes <janx@linux.com> > > Web Inspector: CodeMirrorTextEditor doesn't clear execution line >diff --git a/Source/WebCore/css/StyleResolver.cpp b/Source/WebCore/css/StyleResolver.cpp >index b1edfd02b1f843112aec28d0b35d6fe277a84b17..e77b3e0e2d4d35de7853149117c560fe7774f615 100644 >--- a/Source/WebCore/css/StyleResolver.cpp >+++ b/Source/WebCore/css/StyleResolver.cpp >@@ -60,6 +60,7 @@ > #include "Counter.h" > #include "CounterContent.h" > #include "CursorList.h" >+#include "ElementShadow.h" > #include "FontFeatureValue.h" > #include "FontValue.h" > #include "Frame.h" >@@ -1723,6 +1724,23 @@ static inline bool isAtShadowBoundary(const Element* element) > return parentNode && parentNode->isShadowRoot(); > } > >+static inline bool isDistributedToInsertionPoint(const Element* element) >+{ >+ if (!element) >+ return false; >+ >+ Element* parentElement = element->parentElement(); >+ if (!parentElement) >+ return false; >+ >+ ElementShadow* shadow = parentElement->shadow(); >+ if (!shadow) >+ return false; >+ if (!shadow->insertionPointFor(element)) >+ return false; >+ return true; >+} >+ > PassRefPtr<RenderStyle> StyleResolver::styleForElement(Element* element, RenderStyle* defaultParent, > StyleSharingBehavior sharingBehavior, RuleMatchingBehavior matchingBehavior, RenderRegion* regionForStyling) > { >@@ -1740,8 +1758,10 @@ PassRefPtr<RenderStyle> StyleResolver::styleForElement(Element* element, RenderS > > initElement(element); > initForStyleResolve(element, defaultParent); >+ >+ bool distributedToInsertionPoint = isDistributedToInsertionPoint(element); > m_regionForStyling = regionForStyling; >- if (sharingBehavior == AllowStyleSharing) { >+ if (sharingBehavior == AllowStyleSharing && !distributedToInsertionPoint) { > RenderStyle* sharedStyle = locateSharedStyle(); > if (sharedStyle) > return sharedStyle; >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index f764ff9c6c837614ad46c3077b10943f8dc549b1..0257410f13dcb99280965e5ed511263f54e93b0c 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,18 @@ >+2012-07-06 Takashi Sakamoto <tasak@google.com> >+ >+ [Shadow] distribute nodes don't inherit styles from parentNodeForRenderingAndStyle. >+ https://bugs.webkit.org/show_bug.cgi?id=90661 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * fast/dom/shadow/style-of-distributed-node-expected.txt: Added. >+ * fast/dom/shadow/style-of-distributed-node.html: Added. >+ * fast/dom/shadow/user-modify-inheritance-expected.txt: >+ As this patch also change the user-modify-inheritance's test result, >+ updated the expected result. >+ * fast/dom/shadow/user-modify-inheritance.html: >+ Added FIXME comment. >+ > 2012-08-14 Sukolsak Sakshuwong <sukolsak@google.com> > > Text selection in text area in auto scroll mode goes wrong. >diff --git a/LayoutTests/fast/dom/shadow/style-of-distributed-node-expected.txt b/LayoutTests/fast/dom/shadow/style-of-distributed-node-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..5e83e1c407f9a42d7054c6b615d0a9eea236fab9 >--- /dev/null >+++ b/LayoutTests/fast/dom/shadow/style-of-distributed-node-expected.txt >@@ -0,0 +1,17 @@ >+Tests to ensure that styles of distributed nodes are different if their parent styles are different. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+ >+ >+PASS getColorProperty("child-a") is "rgb(255, 0, 0)" >+PASS getColorProperty("child-b") is "rgb(0, 0, 255)" >+ >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >+ >+ >+ >diff --git a/LayoutTests/fast/dom/shadow/style-of-distributed-node.html b/LayoutTests/fast/dom/shadow/style-of-distributed-node.html >new file mode 100644 >index 0000000000000000000000000000000000000000..38d8b32831fdb8c5ee7b2331fc5ae57faddc52f0 >--- /dev/null >+++ b/LayoutTests/fast/dom/shadow/style-of-distributed-node.html >@@ -0,0 +1,40 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<script src="resources/polyfill.js"></script> >+<script src="../../js/resources/js-test-pre.js"></script> >+<script> >+function getColorProperty(id) { >+ return window.getComputedStyle(document.getElementById(id)).color; >+} >+ >+function log(message) { >+ var console = document.getElementById('console'); >+ console.innerHTML += message + '\n'; >+} >+</script> >+</head> >+<body> >+<pre id="console"></div> >+<div id="test"></div> >+<script> >+description("Tests to ensure that styles of distributed nodes are different if their parent styles are different."); >+ >+if (window.testRunner) >+ testRunner.dumpAsText(); >+ >+var div = document.createElement('div'); >+div.setAttribute('id', 'host'); >+div.style.color = 'red'; >+div.innerHTML = '<div id="child-a"></div><div id="child-b"></div>'; >+ >+var sr = new WebKitShadowRoot(div); >+sr.innerHTML = '<content select="#child-a"></content><div style="color: blue"><content select="#child-b"></content></div>'; >+document.getElementById('test').appendChild(div); >+ >+shouldBe('getColorProperty("child-a")', '"rgb(255, 0, 0)"'); >+shouldBe('getColorProperty("child-b")', '"rgb(0, 0, 255)"'); >+</script> >+<script src="../../js/resources/js-test-post.js"></script> >+</body> >+</html> >diff --git a/LayoutTests/fast/dom/shadow/user-modify-inheritance-expected.txt b/LayoutTests/fast/dom/shadow/user-modify-inheritance-expected.txt >index c76e10d8119ef0668f0cdb816d4d15546093c437..7af24c9db5002726da844ba7cfc163dce728bdc4 100644 >--- a/LayoutTests/fast/dom/shadow/user-modify-inheritance-expected.txt >+++ b/LayoutTests/fast/dom/shadow/user-modify-inheritance-expected.txt >@@ -10,7 +10,7 @@ PASS computedStyle(prepareNodeInShadowRoot(document.getElementById("non-contente > PASS computedStyle(prepareNodeInShadowRoot(document.getElementById("non-contenteditable-host2"), "false"), userModifyPropertyName) is "read-only" > PASS computedStyle(prepareNodeInShadowRoot(document.getElementById("non-contenteditable-host3"), "true"), userModifyPropertyName) is "read-write" > PASS getUserModifyProperty("child-a") is "read-write" >-PASS getUserModifyProperty("child-b") is "read-write" >+FAIL getUserModifyProperty("child-b") should be read-write. Was read-only. > PASS successfullyParsed is true > > TEST COMPLETE >diff --git a/LayoutTests/fast/dom/shadow/user-modify-inheritance.html b/LayoutTests/fast/dom/shadow/user-modify-inheritance.html >index 4ea0c6ae004b65559585aacd645a78957bcfdf1c..b449335fec004e4095da31b75147cc1877f64906 100644 >--- a/LayoutTests/fast/dom/shadow/user-modify-inheritance.html >+++ b/LayoutTests/fast/dom/shadow/user-modify-inheritance.html >@@ -62,6 +62,7 @@ document.getElementById('sandbox').appendChild( > document.body.offsetLeft; > > shouldBeEqualToString('getUserModifyProperty("child-a")', 'read-write'); >+/* FIXME(90017): css property: -user-modify should be inherited from parent.*/ > shouldBeEqualToString('getUserModifyProperty("child-b")', 'read-write'); > > </script>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 90661
:
151026
|
151063
|
151192
|
151208
|
154245
|
158514
|
159616
|
159858
|
159859
|
160115