+2011-08-01 Hayato Ito <hayato@chromium.org>
+
+ Add support for getting an element in shadow root by its id into a window.internals object.
+ https://bugs.webkit.org/show_bug.cgi?id=64587
+
+ Reviewed by Hajime Morita.
+
+ * Source/autotools/symbols.filter:
+
2011-08-01 Neil Roberts <neil@linux.intel.com>
build: Fix finding the headers for GStreamer
+2011-08-01 Hayato Ito <hayato@chromium.org>
+
+ Add support for getting an element in shadow root by its id into a window.internals object.
+ https://bugs.webkit.org/show_bug.cgi?id=64587
+
+ Reviewed by Hajime Morita.
+
+ * fast/dom/shadow/get-element-by-id-in-shadow-root-expected.txt: Added.
+ * fast/dom/shadow/get-element-by-id-in-shadow-root.html: Added.
+ * fast/dom/shadow/resources/create-dom.js: Added.
+ (createShadow):
+ (createDom):
+
2011-08-01 Yury Semikhatsky <yurys@chromium.org>
Web Inspector: typing an expression in an iframe leads to multiple "Unsafe JavaScript attempt to access frame..." errors
--- /dev/null
+Tests to ensure that internals.getElementByIdInTreeScope can get an element in TreeScope by its id. Can only run within DRT
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS getElementInShadow('divA/inputB').id is "inputB"
+PASS getElementInShadow('divA/divC').id is "divC"
+PASS getElementInShadow('divA/divC/inputD').id is "inputD"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
--- /dev/null
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../js/resources/js-test-pre.js"></script>
+<script src="resources/create-dom.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+description("Tests to ensure that internals.getElementByIdInTreeScope can get an element in TreeScope by its id. Can only run within DRT");
+
+function getElementInShadow(path)
+{
+ var ids = path.split('/');
+ var element = document.getElementById(ids[0]);
+ for (var i = 1; element != null && i < ids.length; ++i) {
+ var shadowRoot = internals.shadowRoot(element);
+ element = internals.getElementByIdInShadowRoot(shadowRoot, ids[i]);
+ }
+ return element;
+}
+
+function prepareDomTree(parent)
+{
+ parent.appendChild(
+ createShadow('div', {'id': 'divA'},
+ createDom('input', {'id': 'inputB'}),
+ createShadow('div', {'id': 'divC'},
+ createDom('input', {'id': 'inputD'}))));
+}
+
+function test()
+{
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+ prepareDomTree(document.body);
+ shouldBeEqualToString("getElementInShadow('divA/inputB').id", 'inputB');
+ shouldBeEqualToString("getElementInShadow('divA/divC').id", 'divC');
+ shouldBeEqualToString("getElementInShadow('divA/divC/inputD').id", 'inputD');
+}
+
+test();
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
--- /dev/null
+// This function can take optional child elements as arguments[2:].
+function createShadow(tagName, attributes)
+{
+ var element = document.createElement(tagName);
+ for (var name in attributes)
+ element.setAttribute(name, attributes[name]);
+ var shadow = internals.ensureShadowRoot(element);
+ var childElements = Array.prototype.slice.call(arguments, 2);
+ for (var i = 0; i < childElements.length; ++i)
+ shadow.appendChild(childElements[i]);
+ return element;
+}
+
+// This function can take optional child elements as arguments[2:].
+function createDom(tagName, attributes)
+{
+ var element = document.createElement(tagName);
+ for (var name in attributes)
+ element.setAttribute(name, attributes[name]);
+ var childElements = Array.prototype.slice.call(arguments, 2);
+ for (var i = 0; i < childElements.length; ++i)
+ element.appendChild(childElements[i]);
+ return element;
+}
+2011-08-01 Hayato Ito <hayato@chromium.org>
+
+ Add support for getting an element in shadow root by its id into a window.internals object.
+ https://bugs.webkit.org/show_bug.cgi?id=64587
+
+ Reviewed by Hajime Morita.
+
+ Test: fast/dom/shadow/get-element-by-id-in-shadow-root.html
+
+ * WebCore.exp.in:
+ * testing/Internals.cpp:
+ (WebCore::Internals::getElementByIdInShadowRoot):
+ * testing/Internals.h:
+ * testing/Internals.idl:
+
+2011-07-15 Hayato Ito <hayato@chromium.org>
+
+ Add support for retrieving an element in TreeScope by id to window.internals object.
+ https://bugs.webkit.org/show_bug.cgi?id=64587
+
+ Reviewed by Hajime Morita.
+
+ Test: fast/dom/shadow/get-element-by-id-in-shadow.html
+
+ * WebCore.exp.in:
+ * testing/Internals.cpp:
+ (WebCore::Internals::getElementByIdInTreeScope):
+ * testing/Internals.h:
+ * testing/Internals.idl:
+
2011-08-01 Yury Semikhatsky <yurys@chromium.org>
Web Inspector: typing an expression in an iframe leads to multiple "Unsafe JavaScript attempt to access frame..." errors
__ZNK7WebCore9FrameView28isEnclosedInCompositingLayerEv
__ZNK7WebCore9PageCache10frameCountEv
__ZNK7WebCore9PageCache21autoreleasedPageCountEv
+__ZNK7WebCore9TreeScope14getElementByIdERKN3WTF12AtomicStringE
__ZTVN7WebCore12ChromeClientE
__ZTVN7WebCore12JSDOMWrapperE
__ZTVN7WebCore16IconDatabaseBaseE
return ShadowContentElement::create(document);
}
+Element* Internals::getElementByIdInShadowRoot(Node* shadowRoot, const String& id, ExceptionCode& ec)
+{
+ if (!shadowRoot || !shadowRoot->isShadowRoot()) {
+ ec = INVALID_ACCESS_ERR;
+ return 0;
+ }
+ return toShadowRoot(shadowRoot)->getElementById(id);
+}
+
String Internals::elementRenderTreeAsText(Element* element, ExceptionCode& ec)
{
if (!element) {
Element* includerFor(Node*, ExceptionCode&);
String shadowPseudoId(Element*, ExceptionCode&);
PassRefPtr<Element> createShadowContentElement(Document*, ExceptionCode&);
+ Element* getElementByIdInShadowRoot(Node* shadowRoot, const String& id, ExceptionCode&);
#if ENABLE(INSPECTOR)
void setInspectorResourcesDataSizeLimits(Document*, int maximumResourcesContentSize, int maximumSingleResourceContentSize, ExceptionCode&);
void removeShadowRoot(in Element host) raises (DOMException);
DOMString shadowPseudoId(in Element element) raises (DOMException);
Element createShadowContentElement(in Document document) raises(DOMException);
+ Element getElementByIdInShadowRoot(in Node shadowRoot, in DOMString id) raises(DOMException);
void setInspectorResourcesDataSizeLimits(in Document document, in long maximumResourcesContentSize, in long maximumSingleResourceContentSize) raises(DOMException);
+2011-08-01 Hayato Ito <hayato@chromium.org>
+
+ Add support for getting an element in shadow root by its id into a window.internals object.
+ https://bugs.webkit.org/show_bug.cgi?id=64587
+
+ Reviewed by Hajime Morita.
+
+ * win/WebKit2.def:
+ * win/WebKit2CFLite.def:
+
2011-08-01 Sheriff Bot <webkit.review.bot@gmail.com>
Unreviewed, rolling out r92108.
?ensureShadowRoot@Element@WebCore@@QAEPAVShadowRoot@2@XZ
?externalRepresentation@WebCore@@YA?AVString@WTF@@PAVElement@1@I@Z
?getCachedDOMStructure@WebCore@@YAPAVStructure@JSC@@PAVJSDOMGlobalObject@1@PBUClassInfo@3@@Z
+ ?getElementById@TreeScope@WebCore@@QBEPAVElement@2@ABVAtomicString@WTF@@@Z
?isPreloaded@CachedResourceLoader@WebCore@@QBE_NABVString@WTF@@@Z
?jsStringSlowCase@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@AAV?$HashMap@PAVStringImpl@WTF@@V?$Weak@VJSString@JSC@@@JSC@@UStringHash@2@U?$HashTraits@PAVStringImpl@WTF@@@2@U?$HashTraits@V?$Weak@VJSString@JSC@@@JSC@@@2@@WTF@@PAVStringImpl@6@@Z
?page@Document@WebCore@@QBEPAVPage@2@XZ
?ensureShadowRoot@Element@WebCore@@QAEPAVShadowRoot@2@XZ
?externalRepresentation@WebCore@@YA?AVString@WTF@@PAVElement@1@I@Z
?getCachedDOMStructure@WebCore@@YAPAVStructure@JSC@@PAVJSDOMGlobalObject@1@PBUClassInfo@3@@Z
+ ?getElementById@TreeScope@WebCore@@QBEPAVElement@2@ABVAtomicString@WTF@@@Z
?isPreloaded@CachedResourceLoader@WebCore@@QBE_NABVString@WTF@@@Z
?toJS@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@PAVJSDOMGlobalObject@1@PAVClientRect@1@@Z
?updateLayoutIgnorePendingStylesheets@Document@WebCore@@QAEXXZ
?toElement@WebCore@@YAPAVElement@1@VJSValue@JSC@@@Z
?toJS@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@PAVJSDOMGlobalObject@1@PAVNode@1@@Z
?toNode@WebCore@@YAPAVNode@1@VJSValue@JSC@@@Z
- ?virtualFunctionToPreventWeakVtable@JSDOMWrapper@WebCore@@MAEXXZ
\ No newline at end of file
+ ?virtualFunctionToPreventWeakVtable@JSDOMWrapper@WebCore@@MAEXXZ
_ZNK7WebCore6JSNode21pushEventHandlerScopeEPN3JSC9ExecStateEPNS1_14ScopeChainNodeE;
_ZNK7WebCore7Element10shadowRootEv;
_ZNK7WebCore8Document4pageEv;
+_ZNK7WebCore9TreeScope14getElementByIdERKN3WTF12AtomicStringE;
local:
_Z*;
cti*;