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-20120822141539.patch (text/plain), 8.91 KB, created by
Takashi Sakamoto
on 2012-08-21 22:15:41 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Takashi Sakamoto
Created:
2012-08-21 22:15:41 PDT
Size:
8.91 KB
patch
obsolete
>Subversion Revision: 126260 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index fa8108d70e2e4121825bffa35c5c8978701a59a7..fed72875fcad75539cca18016b0a07eac63e13db 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,36 @@ >+2012-08-21 Takashi Sakamoto <tasak@google.com> >+ >+ Distributed nodes should not share styles. >+ 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::StyleResolver::StyleResolver): >+ Initialized m_distributedToInsertionPoint. Its initial value is false. >+ (WebCore::StyleResolver::initForStyleResolve): >+ After invoking NodeRenderingContext, if the context returns any >+ insertion point, set m_distributedToInsertionPoint to be true. >+ Otherwise, false. The value is used in styleForElement. >+ (WebCore::StyleResolver::styleForElement): >+ If m_distributedToInsertionPoint is true, disable local sibling style >+ cache. >+ * css/StyleResolver.h: >+ (StyleResolver): >+ Added a new member variable, m_distributedToInsertionPoint. >+ The variable keeps whether the m_element is distributed to an >+ insertion point. >+ > 2012-08-21 Sukolsak Sakshuwong <sukolsak@google.com> > > Implement UndoManager's automatic DOM transactions >diff --git a/Source/WebCore/css/StyleResolver.cpp b/Source/WebCore/css/StyleResolver.cpp >index ea5950e54c89040a46f10c29d0082d9fb2af3d9c..a65d8b6d99ac73b449c56177a1c8c17831c5bba3 100644 >--- a/Source/WebCore/css/StyleResolver.cpp >+++ b/Source/WebCore/css/StyleResolver.cpp >@@ -376,6 +376,7 @@ StyleResolver::StyleResolver(Document* document, bool matchAuthorAndUserStyles) > , m_fontDirty(false) > , m_matchAuthorAndUserStyles(matchAuthorAndUserStyles) > , m_sameOriginOnly(false) >+ , m_distributedToInsertionPoint(false) > , m_fontSelector(CSSFontSelector::create(document)) > , m_applyPropertyToRegularStyle(true) > , m_applyPropertyToVisitedLinkStyle(false) >@@ -1220,9 +1221,11 @@ inline void StyleResolver::initForStyleResolve(Element* e, RenderStyle* parentSt > m_parentStyle = context.resetStyleInheritance()? 0 : > parentStyle ? parentStyle : > m_parentNode ? m_parentNode->renderStyle() : 0; >+ m_distributedToInsertionPoint = context.insertionPoint(); > } else { > m_parentNode = 0; > m_parentStyle = parentStyle; >+ m_distributedToInsertionPoint = false; > } > > Node* docElement = e ? e->document()->documentElement() : 0; >@@ -1741,7 +1744,7 @@ PassRefPtr<RenderStyle> StyleResolver::styleForElement(Element* element, RenderS > initElement(element); > initForStyleResolve(element, defaultParent); > m_regionForStyling = regionForStyling; >- if (sharingBehavior == AllowStyleSharing) { >+ if (sharingBehavior == AllowStyleSharing && !m_distributedToInsertionPoint) { > RenderStyle* sharedStyle = locateSharedStyle(); > if (sharedStyle) > return sharedStyle; >diff --git a/Source/WebCore/css/StyleResolver.h b/Source/WebCore/css/StyleResolver.h >index 4e9fe9148de2567abbecbd183b123bce6c885920..d9dfc90eb01c03b048fd4884db7534d391c21df0 100644 >--- a/Source/WebCore/css/StyleResolver.h >+++ b/Source/WebCore/css/StyleResolver.h >@@ -495,6 +495,7 @@ private: > bool m_fontDirty; > bool m_matchAuthorAndUserStyles; > bool m_sameOriginOnly; >+ bool m_distributedToInsertionPoint; > > RefPtr<CSSFontSelector> m_fontSelector; > Vector<OwnPtr<MediaQueryResult> > m_viewportDependentMediaQueryResults; >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index e9752eee1259f0016ad8ed6141303ab057e64dfc..36e62d41110665eb6b6b2200687ddeb118336e45 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,18 @@ >+2012-08-21 Takashi Sakamoto <tasak@google.com> >+ >+ Distributed nodes should not share styles. >+ 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-21 Kenneth Russell <kbr@google.com> > > Unreviewed gardening. Added file somehow missed by garden-o-matic in last rebaseline. >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