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 for landing
bug-82607-20120405110654.patch (text/plain), 11.67 KB, created by
Shinya Kawanaka
on 2012-04-04 19:06:55 PDT
(
hide
)
Description:
Patch for landing
Filename:
MIME Type:
Creator:
Shinya Kawanaka
Created:
2012-04-04 19:06:55 PDT
Size:
11.67 KB
patch
obsolete
>Subversion Revision: 113273 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index a6186299d44b84bb21d4f9e49d0357af627aeff1..b7444b2ca744439bbff6eb7cdef8276d8ca3f833 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,29 @@ >+2012-04-04 Shinya Kawanaka <shinyak@chromium.org> >+ >+ Shadow DOM is exposed in JS. >+ https://bugs.webkit.org/show_bug.cgi?id=82607 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ DOMSelection didn't consider nested shadow trees. This patch makes DOMSelection >+ take nested shadow trees into account. >+ >+ To test that the element is not in a shadow tree, Internals has a treeScopeRootNode method >+ which returns the root node of the belonging tree scope. >+ >+ Test: fast/dom/shadow/selection-shouldnt-expose-shadow-dom.html >+ >+ * WebCore.exp.in: >+ * page/DOMSelection.cpp: >+ (WebCore::selectionShadowAncestor): >+ (WebCore): >+ * testing/Internals.cpp: >+ (WebCore::Internals::treeScopeRootNode): >+ (WebCore): >+ * testing/Internals.h: >+ (Internals): >+ * testing/Internals.idl: >+ > 2012-04-04 Luke Macpherson <macpherson@chromium.org> > > Replace further usage of int with CSSPropertyID. >diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog >index b9c365d6279e12559f38c97ec89bf593638662ee..d4f4eb476923dac7e353c2fe481a871249341f14 100644 >--- a/Source/WebKit2/ChangeLog >+++ b/Source/WebKit2/ChangeLog >@@ -1,3 +1,13 @@ >+2012-04-04 Shinya Kawanaka <shinyak@chromium.org> >+ >+ Shadow DOM is exposed in JS. >+ https://bugs.webkit.org/show_bug.cgi?id=82607 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * win/WebKit2.def: >+ * win/WebKit2CFLite.def: >+ > 2012-04-04 Anders Carlsson <andersca@apple.com> > > Text input doesn't work for some Flash forms >diff --git a/Source/WebCore/WebCore.exp.in b/Source/WebCore/WebCore.exp.in >index 37c4d88722a051b1dc2d8140923b25df5893a5cb..34326a3e177d0da25328ec53985c9209a4c18cfa 100644 >--- a/Source/WebCore/WebCore.exp.in >+++ b/Source/WebCore/WebCore.exp.in >@@ -1173,6 +1173,7 @@ __ZN7WebCore11BitmapImageC1EPNS_13ImageObserverE > __ZN7WebCore5Image7setDataEN3WTF10PassRefPtrINS_12SharedBufferEEEb > __ZNK3JSC8Bindings10RootObject12globalObjectEv > __ZNK3WTF6String14createCFStringEv >+__ZNK7WebCore4Node9treeScopeEv > __ZNK7WebCore10Credential11hasPasswordEv > __ZNK7WebCore10Credential11persistenceEv > __ZNK7WebCore10Credential4userEv >diff --git a/Source/WebCore/page/DOMSelection.cpp b/Source/WebCore/page/DOMSelection.cpp >index 97a438dd030baeb223a2fba7b491cde93a54e818..fd846583ffb5e6c868f8bdfca86ed5a478c41824 100644 >--- a/Source/WebCore/page/DOMSelection.cpp >+++ b/Source/WebCore/page/DOMSelection.cpp >@@ -38,6 +38,7 @@ > #include "PlatformString.h" > #include "Range.h" > #include "TextIterator.h" >+#include "TreeScope.h" > #include "htmlediting.h" > > namespace WebCore { >@@ -47,9 +48,13 @@ static Node* selectionShadowAncestor(Frame* frame) > Node* node = frame->selection()->selection().base().anchorNode(); > if (!node) > return 0; >- Node* shadowAncestor = node->shadowAncestorNode(); >- if (shadowAncestor == node) >+ >+ if (!node->isInShadowTree()) > return 0; >+ >+ Node* shadowAncestor = node->shadowAncestorNode(); >+ while (shadowAncestor->isInShadowTree()) >+ shadowAncestor = shadowAncestor->shadowAncestorNode(); > return shadowAncestor; > } > >diff --git a/Source/WebCore/testing/Internals.cpp b/Source/WebCore/testing/Internals.cpp >index 7b21b543892900402083d1a6d891e5f63921a97e..81f86f25f6964845446eb0eda77bc5f491c26890 100644 >--- a/Source/WebCore/testing/Internals.cpp >+++ b/Source/WebCore/testing/Internals.cpp >@@ -59,6 +59,7 @@ > #include "ShadowTree.h" > #include "SpellChecker.h" > #include "TextIterator.h" >+#include "TreeScope.h" > > #if ENABLE(INPUT_TYPE_COLOR) > #include "ColorChooser.h" >@@ -178,6 +179,16 @@ bool Internals::isValidContentSelect(Element* insertionPoint, ExceptionCode& ec) > return toInsertionPoint(insertionPoint)->isSelectValid(); > } > >+Node* Internals::treeScopeRootNode(Node* node, ExceptionCode& ec) >+{ >+ if (!node) { >+ ec = INVALID_ACCESS_ERR; >+ return 0; >+ } >+ >+ return node->treeScope()->rootNode(); >+} >+ > bool Internals::attached(Node* node, ExceptionCode& ec) > { > if (!node) { >diff --git a/Source/WebCore/testing/Internals.h b/Source/WebCore/testing/Internals.h >index 330d5c08c050c1e2ccbbdd591d57d913795be7fa..82e9a176bf53f5f16e9fbcb30a6b309b6af52a82 100644 >--- a/Source/WebCore/testing/Internals.h >+++ b/Source/WebCore/testing/Internals.h >@@ -81,6 +81,7 @@ public: > PassRefPtr<Element> createContentElement(Document*, ExceptionCode&); > Element* getElementByIdInShadowRoot(Node* shadowRoot, const String& id, ExceptionCode&); > bool isValidContentSelect(Element* insertionPoint, ExceptionCode&); >+ Node* treeScopeRootNode(Node*, ExceptionCode&); > > bool attached(Node*, ExceptionCode&); > >diff --git a/Source/WebCore/testing/Internals.idl b/Source/WebCore/testing/Internals.idl >index dd54fa2de6ef0e1fed2673b3d8a7a228fc58b6a6..071c5bf365672c133598a2cf4fbcaf6ed5b3accf 100644 >--- a/Source/WebCore/testing/Internals.idl >+++ b/Source/WebCore/testing/Internals.idl >@@ -54,6 +54,7 @@ module window { > Element createContentElement(in Document document) raises(DOMException); > Element getElementByIdInShadowRoot(in Node shadowRoot, in DOMString id) raises(DOMException); > boolean isValidContentSelect(in Element contentElement) raises(DOMException); >+ Node treeScopeRootNode(in Node node) raises (DOMException); > > Node nextSiblingByWalker(in Node node) raises(DOMException); > Node firstChildByWalker(in Node node) raises(DOMException); >diff --git a/Source/WebKit2/win/WebKit2.def b/Source/WebKit2/win/WebKit2.def >index f0b76ca1e3ae346acd65e3166fb4ffd1fe6ee806..640e8aff4d7879fc95f7911ec2756786b79e4aa6 100644 >--- a/Source/WebKit2/win/WebKit2.def >+++ b/Source/WebKit2/win/WebKit2.def >@@ -238,6 +238,7 @@ EXPORTS > ?toRange@WebCore@@YAPAVRange@1@VJSValue@JSC@@@Z > ?traverseNextNode@ReifiedTreeTraversal@WebCore@@SAPAVNode@2@PBV32@@Z > ?traversePreviousNode@ReifiedTreeTraversal@WebCore@@SAPAVNode@2@PBV32@@Z >+ ?treeScope@Node@WebCore@@QBEPAVTreeScope@2@XZ > ?updateLayoutIgnorePendingStylesheets@Document@WebCore@@QAEXXZ > ?userPreferredLanguages@WebCore@@YA?AV?$Vector@VString@WTF@@$0A@@WTF@@XZ > ?utf8@String@WTF@@QBE?AVCString@2@_N@Z >diff --git a/Source/WebKit2/win/WebKit2CFLite.def b/Source/WebKit2/win/WebKit2CFLite.def >index dd6b2cc97d3945fe475e9517118b8f6af2a8681a..3712f98365a6025c8fd537190cb8106d4636c0ef 100644 >--- a/Source/WebKit2/win/WebKit2CFLite.def >+++ b/Source/WebKit2/win/WebKit2CFLite.def >@@ -231,6 +231,7 @@ EXPORTS > ?toRange@WebCore@@YAPAVRange@1@VJSValue@JSC@@@Z > ?traverseNextNode@ReifiedTreeTraversal@WebCore@@SAPAVNode@2@PBV32@@Z > ?traversePreviousNode@ReifiedTreeTraversal@WebCore@@SAPAVNode@2@PBV32@@Z >+ ?treeScope@Node@WebCore@@QBEPAVTreeScope@2@XZ > ?updateLayoutIgnorePendingStylesheets@Document@WebCore@@QAEXXZ > ?userPreferredLanguages@WebCore@@YA?AV?$Vector@VString@WTF@@$0A@@WTF@@XZ > ?utf8@String@WTF@@QBE?AVCString@2@_N@Z >diff --git a/Source/autotools/symbols.filter b/Source/autotools/symbols.filter >index df9430952be0c5bdf47cc5093817aa5ad94426a9..42d809a9a63f35197817b28807a849f0f621ed46 100644 >--- a/Source/autotools/symbols.filter >+++ b/Source/autotools/symbols.filter >@@ -91,6 +91,7 @@ _ZN7WebCore9JSElement10putVirtualEPN3JSC9ExecStateERKNS1_10IdentifierENS1_7JSVal > _ZN7WebCore9JSElement6s_infoE; > _ZN7WebCore9toElementEN3JSC7JSValueE; > _ZNK7WebCore4Node31numberOfScopedHTMLStyleChildrenEv; >+_ZNK7WebCore4Node9treeScopeEv; > _ZNK7WebCore12RenderObject23absoluteBoundingBoxRectEb; > _ZNK7WebCore16HTMLInputElement14suggestedValueEv; > _ZNK7WebCore17JSDOMGlobalObject22scriptExecutionContextEv; >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 7230e0bde391f2a699c9b5d2954f0641b95a2179..9677cb24e7aaf1c8d5abc0792821cc717b119b15 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,13 @@ >+2012-04-04 Shinya Kawanaka <shinyak@chromium.org> >+ >+ Shadow DOM is exposed in JS. >+ https://bugs.webkit.org/show_bug.cgi?id=82607 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * fast/dom/shadow/selection-shouldnt-expose-shadow-dom-expected.txt: Added. >+ * fast/dom/shadow/selection-shouldnt-expose-shadow-dom.html: Added. >+ > 2012-04-04 Oliver Hunt <oliver@apple.com> > > Parser fails to revert some state after parsing expression and object literals. >diff --git a/LayoutTests/fast/dom/shadow/selection-shouldnt-expose-shadow-dom-expected.txt b/LayoutTests/fast/dom/shadow/selection-shouldnt-expose-shadow-dom-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..e02e0ea893a2fc0e8e9bd3374b3e9d77d622caeb >--- /dev/null >+++ b/LayoutTests/fast/dom/shadow/selection-shouldnt-expose-shadow-dom-expected.txt >@@ -0,0 +1,6 @@ >+PASS internals.treeScopeRootNode(selection.anchorNode) is document >+PASS internals.treeScopeRootNode(selection.focusNode) is document >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >diff --git a/LayoutTests/fast/dom/shadow/selection-shouldnt-expose-shadow-dom.html b/LayoutTests/fast/dom/shadow/selection-shouldnt-expose-shadow-dom.html >new file mode 100644 >index 0000000000000000000000000000000000000000..32893c8f8901ac1aec1d946603ed6aa36e741cc7 >--- /dev/null >+++ b/LayoutTests/fast/dom/shadow/selection-shouldnt-expose-shadow-dom.html >@@ -0,0 +1,57 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<script src="../../js/resources/js-test-pre.js"></script> >+</head> >+<body> >+ >+<pre id="console"></pre> >+<div id="container"></div> >+ >+<script> >+function moveTo(element) { >+ var x = element.offsetLeft + element.offsetWidth / 2; >+ var y = element.offsetTop + element.offsetHeight / 2; >+ eventSender.mouseMoveTo(x, y); >+} >+ >+function dragFromTo(elementFrom, elementTo) { >+ moveTo(elementFrom); >+ eventSender.mouseDown(); >+ moveTo(elementTo); >+ eventSender.mouseUp(); >+} >+ >+var container = document.getElementById('container'); >+ >+var shadowRoot1 = new WebKitShadowRoot(container); >+shadowRoot1.innerHTML = >+ '<div id="div1" title="div1">You Satoh</div>' + >+ '<div id="div2" title="div2">Sen Yarizui</div>' + >+ '<div id="div3" title="div3">Ayame Shaga</div>'; >+var div1 = shadowRoot1.getElementById('div1'); >+var div2 = shadowRoot1.getElementById('div2'); >+var div3 = shadowRoot1.getElementById('div3'); >+ >+var shadowRoot2 = new WebKitShadowRoot(div2); >+shadowRoot2.innerHTML = >+ '<div id="div4" title="div4">Hana Oshiroi</div>' + >+ '<div id="div5" title="div5">Ume Shiraume</div>' + >+ '<div id="div6" title="div6">Mikoto Uzu</div>'; >+var div4 = shadowRoot2.getElementById('div4'); >+var div5 = shadowRoot2.getElementById('div5'); >+var div6 = shadowRoot2.getElementById('div6'); >+ >+dragFromTo(div4, div6); >+var selection = window.getSelection(); >+ >+// If anchodeNode and focusNode are not in Shadow tree, document is returned >+// by internals.treeScopeRootNode(). >+shouldBe('internals.treeScopeRootNode(selection.anchorNode)', 'document'); >+shouldBe('internals.treeScopeRootNode(selection.focusNode)', 'document'); >+ >+var successfullyParsed = true; >+</script> >+<script src="../../js/resources/js-test-post.js"></script> >+</body> >+</html> >diff --git a/ChangeLog b/ChangeLog >index 1d1de2b2d865eb0be4b111bfa5420ef735dd668e..8c1730be9b2d411a09d2c94cf0dc2f1a6ce4f08d 100644 >--- a/ChangeLog >+++ b/ChangeLog >@@ -1,3 +1,12 @@ >+2012-04-04 Shinya Kawanaka <shinyak@chromium.org> >+ >+ Shadow DOM is exposed in JS. >+ https://bugs.webkit.org/show_bug.cgi?id=82607 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Source/autotools/symbols.filter: >+ > 2012-04-03 Tony Chang <tony@chromium.org> > > remove WebKit files from .gitattributes
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 82607
:
134560
|
135038
|
135060
|
135064
|
135076
|
135079
|
135096
|
135108
|
135252
|
135515
| 135743