Title: [89230] trunk
Revision
89230
Author
morr...@google.com
Date
2011-06-19 22:08:10 -0700 (Sun, 19 Jun 2011)

Log Message

2011-06-19  MORITA Hajime  <morr...@google.com>

        Reviewed by Dimitri Glazkov.

        The internals object should have createShadowContentElement()
        https://bugs.webkit.org/show_bug.cgi?id=62432

        * Source/autotools/symbols.filter: Added some more symbols necessary for
        window.internals to function to the global symbol list.

2011-06-19  MORITA Hajime  <morr...@google.com>

        Reviewed by Dimitri Glazkov.

        The internals object should have createShadowContentElement()
        https://bugs.webkit.org/show_bug.cgi?id=62432

        * fast/dom/shadow/create-content-element-expected.txt: Added.
        * fast/dom/shadow/create-content-element.html: Added.
2011-06-19  MORITA Hajime  <morr...@google.com>

        Reviewed by Dimitri Glazkov.

        The internals object should have createShadowContentElement()
        https://bugs.webkit.org/show_bug.cgi?id=62432

        This change:
        - added Internals::createShadowContentElement(), which creates,
          ShadowContentElement instance which includes all host children,
        - added Internals::elementRenderTreeAsText() to help content layout testing, and
        - Unabstracted ShadowContentElement by giving a default shouldInclude() implementation.

        Test: fast/dom/shadow/create-content-element.html

        * WebCore.exp.in:
        * dom/ShadowContentElement.cpp:
        (WebCore::ShadowContentElement::create): Added.
        (WebCore::ShadowContentElement::ShadowContentElement):
        (WebCore::ShadowContentElement::~ShadowContentElement):
        (WebCore::ShadowContentElement::shouldInclude): Gave a default implementation which always returns true.
        * dom/ShadowContentElement.h:
        * html/HTMLSummaryElement.cpp:
        (WebCore::SummaryContentElement::SummaryContentElement):
        * rendering/RenderTreeAsText.cpp:
        (WebCore::externalRepresentation): Factored out for supportin per-element render tree dump.
        * rendering/RenderTreeAsText.h:
        * testing/Internals.cpp:
        (WebCore::Internals::createShadowContentElement): Added.
        (WebCore::Internals::elementRenderTreeAsText): dded.
        * testing/Internals.h:
        * testing/Internals.idl:
2011-06-19  MORITA Hajime  <morr...@google.com>

        Reviewed by Dimitri Glazkov.

        The internals object should have createShadowContentElement()
        https://bugs.webkit.org/show_bug.cgi?id=62432

        * win/WebKit2.def: Added some more symbols necessary for
        window.internals to function to the global symbol list.

Modified Paths

Added Paths

Diff

Modified: trunk/ChangeLog (89229 => 89230)


--- trunk/ChangeLog	2011-06-20 04:47:20 UTC (rev 89229)
+++ trunk/ChangeLog	2011-06-20 05:08:10 UTC (rev 89230)
@@ -1,3 +1,14 @@
+2011-06-19  MORITA Hajime  <morr...@google.com>
+
+        Reviewed by Dimitri Glazkov.
+
+        The internals object should have createShadowContentElement()
+        https://bugs.webkit.org/show_bug.cgi?id=62432
+
+        * Source/autotools/symbols.filter: Added some more symbols necessary for
+        window.internals to function to the global symbol list.
+        
+
 2011-06-19  Adam Bergkvist  <adam.bergkv...@ericsson.com>
 
         Reviewed by Martin Robinson.

Modified: trunk/LayoutTests/ChangeLog (89229 => 89230)


--- trunk/LayoutTests/ChangeLog	2011-06-20 04:47:20 UTC (rev 89229)
+++ trunk/LayoutTests/ChangeLog	2011-06-20 05:08:10 UTC (rev 89230)
@@ -1,3 +1,13 @@
+2011-06-19  MORITA Hajime  <morr...@google.com>
+
+        Reviewed by Dimitri Glazkov.
+
+        The internals object should have createShadowContentElement()
+        https://bugs.webkit.org/show_bug.cgi?id=62432
+
+        * fast/dom/shadow/create-content-element-expected.txt: Added.
+        * fast/dom/shadow/create-content-element.html: Added.
+
 2011-06-19  Keishi Hattori  <kei...@webkit.org>
 
         Reviewed by Kent Tamura.

Added: trunk/LayoutTests/fast/dom/shadow/create-content-element-expected.txt (0 => 89230)


--- trunk/LayoutTests/fast/dom/shadow/create-content-element-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/dom/shadow/create-content-element-expected.txt	2011-06-20 05:08:10 UTC (rev 89230)
@@ -0,0 +1,3 @@
+This test compares a shadow-based render tree with one for a refrence DOM tree.
+PASS
+
Property changes on: trunk/LayoutTests/fast/dom/shadow/create-content-element-expected.txt
___________________________________________________________________

Added: svn:eol-style

Added: trunk/LayoutTests/fast/dom/shadow/create-content-element.html (0 => 89230)


--- trunk/LayoutTests/fast/dom/shadow/create-content-element.html	                        (rev 0)
+++ trunk/LayoutTests/fast/dom/shadow/create-content-element.html	2011-06-20 05:08:10 UTC (rev 89230)
@@ -0,0 +1,70 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+/* relative positioning ensures underlying RenderLayer */
+.container {
+    position: relative;
+}
+</style>
+<script>
+function log(message)
+{
+    document.getElementById("console").innerHTML += (message + "\n");
+}
+
+function removeContainerLines(text)
+{
+    var lines = text.split("\n");
+    lines.splice(0, 2);
+    return lines.join("\n");
+}
+
+function setupTargetTree()
+{
+    var target = document.createElement("div");
+    target.innerHTML = "<span>content</span>";
+    var root = layoutTestController.ensureShadowRoot(target);
+    
+    var child0 = document.createElement("span");
+    child0.innerHTML = "Hello,";
+    root.appendChild(child0);
+    root.appendChild(window.internals.createShadowContentElement(document));
+    var child1 = document.createElement("span");
+    child1.innerHTML = "World.";
+    root.appendChild(child1);
+
+    document.getElementById("target").appendChild(target);
+}
+
+function test()
+{
+    layoutTestController.dumpAsText();
+    log("This test compares a shadow-based render tree with one for a refrence DOM tree.");
+    setupTargetTree();
+    var targetContainerRenderTree = window.internals.elementRenderTreeAsText(document.getElementById("targetContainer"));
+    var targetRenderTree = removeContainerLines(targetContainerRenderTree);
+    var refContainerRenderTree = window.internals.elementRenderTreeAsText(document.getElementById("refContainer"));
+    var refRenderTree = removeContainerLines(refContainerRenderTree);
+    if (targetRenderTree == refRenderTree)
+        log("PASS");
+    else {
+        log("FAIL");
+        log("Expected:");
+        log(refRenderTree);
+        log("Actual:");
+        log(targetRenderTree);
+    }
+    
+    document.getElementById("test").style.display = "none";
+}
+</script>
+</head>
+<body _onload_="test()">
+<div id="test">
+<div class="container" id="targetContainer"><div id="target"></div></div>
+<div class="container" id="refContainer"><div><div><span>Hello,</span><span>content</span><span>World.</span></div></div></div>
+</div>
+<pre id="console"></pre>
+</body>
+</html>
Property changes on: trunk/LayoutTests/fast/dom/shadow/create-content-element.html
___________________________________________________________________

Added: svn:eol-style

Modified: trunk/Source/WebCore/ChangeLog (89229 => 89230)


--- trunk/Source/WebCore/ChangeLog	2011-06-20 04:47:20 UTC (rev 89229)
+++ trunk/Source/WebCore/ChangeLog	2011-06-20 05:08:10 UTC (rev 89230)
@@ -1,3 +1,36 @@
+2011-06-19  MORITA Hajime  <morr...@google.com>
+
+        Reviewed by Dimitri Glazkov.
+
+        The internals object should have createShadowContentElement()
+        https://bugs.webkit.org/show_bug.cgi?id=62432
+
+        This change:
+        - added Internals::createShadowContentElement(), which creates,
+          ShadowContentElement instance which includes all host children,
+        - added Internals::elementRenderTreeAsText() to help content layout testing, and
+        - Unabstracted ShadowContentElement by giving a default shouldInclude() implementation.
+        
+        Test: fast/dom/shadow/create-content-element.html
+
+        * WebCore.exp.in:
+        * dom/ShadowContentElement.cpp:
+        (WebCore::ShadowContentElement::create): Added.
+        (WebCore::ShadowContentElement::ShadowContentElement):
+        (WebCore::ShadowContentElement::~ShadowContentElement):
+        (WebCore::ShadowContentElement::shouldInclude): Gave a default implementation which always returns true.
+        * dom/ShadowContentElement.h:
+        * html/HTMLSummaryElement.cpp:
+        (WebCore::SummaryContentElement::SummaryContentElement):
+        * rendering/RenderTreeAsText.cpp:
+        (WebCore::externalRepresentation): Factored out for supportin per-element render tree dump.
+        * rendering/RenderTreeAsText.h:
+        * testing/Internals.cpp:
+        (WebCore::Internals::createShadowContentElement): Added.
+        (WebCore::Internals::elementRenderTreeAsText): dded.
+        * testing/Internals.h:
+        * testing/Internals.idl:
+
 2011-06-19  Keishi Hattori  <kei...@webkit.org>
 
         Reviewed by Kent Tamura.

Modified: trunk/Source/WebCore/WebCore.exp.in (89229 => 89230)


--- trunk/Source/WebCore/WebCore.exp.in	2011-06-20 04:47:20 UTC (rev 89229)
+++ trunk/Source/WebCore/WebCore.exp.in	2011-06-20 05:08:10 UTC (rev 89230)
@@ -140,6 +140,7 @@
 __ZN7WebCore10CredentialC1ERKN3WTF6StringES4_NS_21CredentialPersistenceE
 __ZN7WebCore10CredentialC1Ev
 __ZN7WebCore10FloatPointC1ERKNS_8IntPointE
+__ZN7WebCore10JSDocument3putEPN3JSC9ExecStateERKNS1_10IdentifierENS1_7JSValueERNS1_15PutPropertySlotE
 __ZN7WebCore10JSDocument6s_infoE
 __ZN7WebCore10MouseEvent6createERKN3WTF12AtomicStringENS1_10PassRefPtrINS_9DOMWindowEEERKNS_18PlatformMouseEventEiNS5_INS_4NodeEEE
 __ZN7WebCore10MouseEventC1ERKN3WTF12AtomicStringEbbNS1_10PassRefPtrINS_9DOMWindowEEEiiiiibbbbtNS5_INS_11EventTargetEEENS5_INS_9ClipboardEEEb
@@ -150,6 +151,7 @@
 __ZN7WebCore10deleteFileERKN3WTF6StringE
 __ZN7WebCore10handCursorEv
 __ZN7WebCore10setCookiesEPNS_8DocumentERKNS_4KURLERKN3WTF6StringE
+__ZN7WebCore10toDocumentEN3JSC7JSValueE
 __ZN7WebCore11BitmapImageC1EP7CGImagePNS_13ImageObserverE
 __ZN7WebCore11CachedFrame23cachedFramePlatformDataEv
 __ZN7WebCore11CachedFrame26setCachedFramePlatformDataEN3WTF10PassOwnPtrINS_23CachedFramePlatformDataEEE
@@ -351,8 +353,8 @@
 __ZN7WebCore14FrameSelection15revealSelectionERKNS_15ScrollAlignmentEb
 __ZN7WebCore14FrameSelection16setSelectedRangeEPNS_5RangeENS_9EAffinityEb
 __ZN7WebCore14FrameSelection20setSelectionFromNoneEv
+__ZN7WebCore14FrameSelection5clearEv
 __ZN7WebCore14FrameSelection6modifyENS0_11EAlterationENS_18SelectionDirectionENS_15TextGranularityEb
-__ZN7WebCore14FrameSelection5clearEv
 __ZN7WebCore14FrameSelection9selectAllEv
 __ZN7WebCore14FrameSelectionC1EPNS_5FrameE
 __ZN7WebCore14ResourceHandle12releaseProxyEv
@@ -435,6 +437,7 @@
 __ZN7WebCore15localizedStringEPKc
 __ZN7WebCore15pathGetFileNameERKN3WTF6StringE
 __ZN7WebCore15reportExceptionEPN3JSC9ExecStateENS0_7JSValueE
+__ZN7WebCore15setDOMExceptionEPN3JSC9ExecStateEi
 __ZN7WebCore15visitedLinkHashEPKtj
 __ZN7WebCore16AbstractDatabase14setIsAvailableEb
 __ZN7WebCore16DeviceMotionData12Acceleration6createEbdbdbd
@@ -488,14 +491,15 @@
 __ZN7WebCore16enclosingIntRectERKNS_9FloatRectE
 __ZN7WebCore16isEndOfParagraphERKNS_15VisiblePositionENS_27EditingBoundaryCrossingRuleE
 __ZN7WebCore16startOfParagraphERKNS_15VisiblePositionENS_27EditingBoundaryCrossingRuleE
+__ZN7WebCore17CredentialStorage24getFromPersistentStorageERKNS_15ProtectionSpaceE
 __ZN7WebCore17CredentialStorage3getERKNS_15ProtectionSpaceE
-__ZN7WebCore17CredentialStorage24getFromPersistentStorageERKNS_15ProtectionSpaceE
 __ZN7WebCore17DOMImplementation13isXMLMIMETypeERKN3WTF6StringE
 __ZN7WebCore17DOMImplementation14isTextMIMETypeERKN3WTF6StringE
 __ZN7WebCore17DeviceOrientation6createEbdbdbd
 __ZN7WebCore17GlyphPageTreeNode18treeGlyphPageCountEv
 __ZN7WebCore17HistoryController26saveDocumentAndScrollStateEv
 __ZN7WebCore17HistoryController33restoreScrollPositionAndViewStateEv
+__ZN7WebCore17cacheDOMStructureEPNS_17JSDOMGlobalObjectEPN3JSC9StructureEPKNS2_9ClassInfoE
 __ZN7WebCore17nameForCursorTypeENS_6Cursor4TypeE
 __ZN7WebCore17openTemporaryFileERKN3WTF6StringERi
 __ZN7WebCore18PlatformMouseEventC1EP7NSEventP6NSView
@@ -540,6 +544,7 @@
 __ZN7WebCore20RenderEmbeddedObject30setShowsCrashedPluginIndicatorEv
 __ZN7WebCore20ResourceResponseBase24setExpectedContentLengthEx
 __ZN7WebCore20ResourceResponseBaseC2Ev
+__ZN7WebCore20ShadowContentElement6createEPNS_8DocumentE
 __ZN7WebCore20SpaceSplitStringData12createVectorEv
 __ZN7WebCore20UserGestureIndicator7s_stateE
 __ZN7WebCore20UserGestureIndicatorC1ENS_26ProcessingUserGestureStateE
@@ -547,7 +552,6 @@
 __ZN7WebCore20makeRGBA32FromFloatsEffff
 __ZN7WebCore20protocolIsJavaScriptERKN3WTF6StringE
 __ZN7WebCore21BackForwardController11itemAtIndexEi
-__ZN7WebCore21memoryPressureHandlerEv
 __ZN7WebCore21MemoryPressureHandler7installEv
 __ZN7WebCore21PlatformKeyboardEvent24disambiguateKeyDownEventENS0_4TypeEb
 __ZN7WebCore21PlatformKeyboardEventC1EP7NSEvent
@@ -562,9 +566,11 @@
 __ZN7WebCore21WindowsLatin1EncodingEv
 __ZN7WebCore21applicationIsApertureEv
 __ZN7WebCore21findEventWithKeyStateEPNS_5EventE
+__ZN7WebCore21getCachedDOMStructureEPNS_17JSDOMGlobalObjectEPKN3JSC9ClassInfoE
 __ZN7WebCore21isBackForwardLoadTypeENS_13FrameLoadTypeE
 __ZN7WebCore21mainThreadNormalWorldEv
 __ZN7WebCore21markerTextForListItemEPNS_7ElementE
+__ZN7WebCore21memoryPressureHandlerEv
 __ZN7WebCore21reportThreadViolationEPKcNS_20ThreadViolationRoundE
 __ZN7WebCore21resourceLoadSchedulerEv
 __ZN7WebCore21setGlobalIconDatabaseEPNS_16IconDatabaseBaseE
@@ -576,6 +582,7 @@
 __ZN7WebCore22counterValueForElementEPNS_7ElementE
 __ZN7WebCore22createFragmentFromTextEPNS_5RangeERKN3WTF6StringE
 __ZN7WebCore22externalRepresentationEPNS_5FrameEj
+__ZN7WebCore22externalRepresentationEPNS_7ElementEj
 __ZN7WebCore23AuthenticationChallengeC1ERKNS_15ProtectionSpaceERKNS_10CredentialEjRKNS_16ResourceResponseERKNS_13ResourceErrorE
 __ZN7WebCore23ReplaceSelectionCommandC1EPNS_8DocumentEN3WTF10PassRefPtrINS_16DocumentFragmentEEEjNS_10EditActionE
 __ZN7WebCore23createFragmentFromNodesEPNS_8DocumentERKN3WTF6VectorIPNS_4NodeELm0EEE
@@ -793,6 +800,9 @@
 __ZN7WebCore6Editor7CommandC1Ev
 __ZN7WebCore6Editor7commandERKN3WTF6StringE
 __ZN7WebCore6Editor7outdentEv
+__ZN7WebCore6JSNode13visitChildrenERN3JSC11SlotVisitorE
+__ZN7WebCore6JSNode3putEPN3JSC9ExecStateERKNS1_10IdentifierENS1_7JSValueERNS1_15PutPropertySlotE
+__ZN7WebCore6JSNode6s_infoE
 __ZN7WebCore6Widget12setFrameRectERKNS_7IntRectE
 __ZN7WebCore6Widget13setBoundsSizeERKNS_7IntSizeE
 __ZN7WebCore6Widget16removeFromParentEv
@@ -933,7 +943,6 @@
 __ZN7WebCore9FrameView14setMarginWidthEi
 __ZN7WebCore9FrameView14setNeedsLayoutEv
 __ZN7WebCore9FrameView14setTransparentEb
-__ZNK7WebCore9FrameView13isTransparentEv
 __ZN7WebCore9FrameView15setMarginHeightEi
 __ZN7WebCore9FrameView16setPaintBehaviorEj
 __ZN7WebCore9FrameView17setScrollPositionERKNS_8IntPointE
@@ -941,7 +950,6 @@
 __ZN7WebCore9FrameView20enterCompositingModeEv
 __ZN7WebCore9FrameView21flushDeferredRepaintsEv
 __ZN7WebCore9FrameView22setBaseBackgroundColorERKNS_5ColorE
-__ZNK7WebCore9FrameView19baseBackgroundColorEv
 __ZN7WebCore9FrameView23updateCanHaveScrollbarsEv
 __ZN7WebCore9FrameView24forceLayoutForPaginationERKNS_9FloatSizeEfNS_19AdjustViewSizeOrNotE
 __ZN7WebCore9FrameView26adjustPageHeightDeprecatedEPffff
@@ -988,6 +996,7 @@
 __ZN7WebCore9HTMLNames9iframeTagE
 __ZN7WebCore9HTMLNames9objectTagE
 __ZN7WebCore9HTMLNames9scriptTagE
+__ZN7WebCore9JSElement3putEPN3JSC9ExecStateERKNS1_10IdentifierENS1_7JSValueERNS1_15PutPropertySlotE
 __ZN7WebCore9JSElement6s_infoE
 __ZN7WebCore9PageCache11setCapacityEi
 __ZN7WebCore9PageCache27releaseAutoreleasedPagesNowEv
@@ -1019,11 +1028,8 @@
 __ZN7WebCore9pageCacheEv
 __ZN7WebCore9plainTextEPKNS_5RangeENS_20TextIteratorBehaviorE
 __ZN7WebCore9toElementEN3JSC7JSValueE
-__ZN7WebCore17cacheDOMStructureEPNS_17JSDOMGlobalObjectEPN3JSC9StructureEPKNS2_9ClassInfoE
-__ZN7WebCore21getCachedDOMStructureEPNS_17JSDOMGlobalObjectEPKN3JSC9ClassInfoE
 __ZNK3JSC8Bindings10RootObject12globalObjectEv
 __ZNK3WTF6String14createCFStringEv
-__ZNK7WebCore5Frame26getDocumentBackgroundColorEv
 __ZNK7WebCore10Credential11hasPasswordEv
 __ZNK7WebCore10Credential11persistenceEv
 __ZNK7WebCore10Credential4userEv
@@ -1223,6 +1229,7 @@
 __ZNK7WebCore5Frame15contentRendererEv
 __ZNK7WebCore5Frame15layerTreeAsTextEb
 __ZNK7WebCore5Frame18documentTypeStringEv
+__ZNK7WebCore5Frame26getDocumentBackgroundColorEv
 __ZNK7WebCore5Frame31displayStringModifiedByEncodingERKN3WTF6StringE
 __ZNK7WebCore5Frame8settingsEv
 __ZNK7WebCore5Frame9domWindowEv
@@ -1261,6 +1268,7 @@
 __ZNK7WebCore6Editor7canEditEv
 __ZNK7WebCore6Editor8canPasteEv
 __ZNK7WebCore6Editor9canDeleteEv
+__ZNK7WebCore6JSNode21pushEventHandlerScopeEPN3JSC9ExecStateEPNS1_14ScopeChainNodeE
 __ZNK7WebCore6Widget14platformWidgetEv
 __ZNK7WebCore6Widget23convertToContainingViewERKNS_7IntRectE
 __ZNK7WebCore6Widget23convertToContainingViewERKNS_8IntPointE
@@ -1308,7 +1316,9 @@
 __ZNK7WebCore9FrameTree4findERKN3WTF12AtomicStringE
 __ZNK7WebCore9FrameTree6parentEb
 __ZNK7WebCore9FrameView11needsLayoutEv
+__ZNK7WebCore9FrameView13isTransparentEv
 __ZNK7WebCore9FrameView13paintBehaviorEv
+__ZNK7WebCore9FrameView19baseBackgroundColorEv
 __ZNK7WebCore9FrameView20isSoftwareRenderableEv
 __ZNK7WebCore9FrameView22windowClipRectForLayerEPKNS_11RenderLayerEb
 __ZNK7WebCore9FrameView28isEnclosedInCompositingLayerEv

Modified: trunk/Source/WebCore/dom/ShadowContentElement.cpp (89229 => 89230)


--- trunk/Source/WebCore/dom/ShadowContentElement.cpp	2011-06-20 04:47:20 UTC (rev 89229)
+++ trunk/Source/WebCore/dom/ShadowContentElement.cpp	2011-06-20 05:08:10 UTC (rev 89230)
@@ -27,10 +27,26 @@
 #include "config.h"
 #include "ShadowContentElement.h"
 
+#include "HTMLNames.h"
 #include "ShadowContentSelector.h"
 
 namespace WebCore {
 
+PassRefPtr<ShadowContentElement> ShadowContentElement::create(Document* document)
+{
+    DEFINE_STATIC_LOCAL(QualifiedName, tagName, (nullAtom, "webkitShadowContent", HTMLNames::divTag.namespaceURI()));
+    return adoptRef(new ShadowContentElement(tagName, document));
+}
+
+ShadowContentElement::ShadowContentElement(const QualifiedName& name, Document* document)
+    : StyledElement(name, document, CreateHTMLElement)
+{
+}
+
+ShadowContentElement::~ShadowContentElement()
+{
+}
+
 void ShadowContentElement::attach()
 {
     ASSERT(!firstChild()); // Currently doesn't support any light child.
@@ -52,4 +68,9 @@
     StyledElement::detach();
 }
 
+bool ShadowContentElement::shouldInclude(Node*)
+{
+    return true;
 }
+
+}

Modified: trunk/Source/WebCore/dom/ShadowContentElement.h (89229 => 89230)


--- trunk/Source/WebCore/dom/ShadowContentElement.h	2011-06-20 04:47:20 UTC (rev 89229)
+++ trunk/Source/WebCore/dom/ShadowContentElement.h	2011-06-20 05:08:10 UTC (rev 89230)
@@ -40,18 +40,19 @@
 // You should create ShadowContentElement during the host construction.
 class ShadowContentElement : public StyledElement {
 public:
-    ShadowContentElement(const QualifiedName& name, Document* document)
-        : StyledElement(name, document, CreateHTMLElement)
-    {
-    }
+    static PassRefPtr<ShadowContentElement> create(Document*);
 
-    virtual bool shouldInclude(Node*) = 0;
+    virtual ~ShadowContentElement();
+    virtual bool shouldInclude(Node*);
     virtual void attach();
     virtual void detach();
 
     Node* inclusionAt(size_t) const;
     size_t inclusionCount() const;
 
+protected:
+    ShadowContentElement(const QualifiedName&, Document*);
+
 private:
     virtual bool isContentElement() const { return true; }
     virtual bool rendererIsNeeded(const NodeRenderingContext&) { return false; }

Modified: trunk/Source/WebCore/html/HTMLSummaryElement.cpp (89229 => 89230)


--- trunk/Source/WebCore/html/HTMLSummaryElement.cpp	2011-06-20 04:47:20 UTC (rev 89229)
+++ trunk/Source/WebCore/html/HTMLSummaryElement.cpp	2011-06-20 05:08:10 UTC (rev 89230)
@@ -46,8 +46,6 @@
         : ShadowContentElement(HTMLNames::divTag, document)
     {
     }
-
-    virtual bool shouldInclude(Node*) { return true; }
 };
 
 PassRefPtr<SummaryContentElement> SummaryContentElement::create(Document* document)

Modified: trunk/Source/WebCore/rendering/RenderTreeAsText.cpp (89229 => 89230)


--- trunk/Source/WebCore/rendering/RenderTreeAsText.cpp	2011-06-20 04:47:20 UTC (rev 89229)
+++ trunk/Source/WebCore/rendering/RenderTreeAsText.cpp	2011-06-20 05:08:10 UTC (rev 89230)
@@ -756,29 +756,44 @@
            << "selection end:   position " << selection.end().deprecatedEditingOffset() << " of " << nodePosition(selection.end().deprecatedNode()) << "\n";
 }
 
+static String externalRepresentation(RenderBox* renderer, RenderAsTextBehavior behavior)
+{
+    TextStream ts;
+    if (!renderer->hasLayer())
+        ts.release();
+        
+    RenderLayer* layer = renderer->layer();
+    writeLayers(ts, layer, layer, layer->rect(), 0, behavior);
+    writeSelection(ts, renderer);
+    return ts.release();
+}
+
 String externalRepresentation(Frame* frame, RenderAsTextBehavior behavior)
 {
+    RenderObject* renderer = frame->contentRenderer();
+    if (!renderer || !renderer->isBox())
+        return String();
+
     PrintContext printContext(frame);
-    if (behavior & RenderAsTextPrintingMode) {
-        if (!frame->contentRenderer())
-            return String();
-        printContext.begin(frame->contentRenderer()->width());
-    }
-
+    if (behavior & RenderAsTextPrintingMode)
+        printContext.begin(toRenderBox(renderer)->width());
     if (!(behavior & RenderAsTextDontUpdateLayout))
         frame->document()->updateLayout();
 
-    RenderObject* o = frame->contentRenderer();
-    if (!o)
+    return externalRepresentation(toRenderBox(renderer), behavior);
+}
+
+String externalRepresentation(Element* element, RenderAsTextBehavior behavior)
+{
+    RenderObject* renderer = element->renderer();
+    if (!renderer || !renderer->isBox())
         return String();
-
-    TextStream ts;
-    if (o->hasLayer()) {
-        RenderLayer* l = toRenderBox(o)->layer();
-        writeLayers(ts, l, l, l->rect(), 0, behavior);
-        writeSelection(ts, o);
-    }
-    return ts.release();
+    // Doesn't support printing mode.
+    ASSERT(!(behavior & RenderAsTextPrintingMode));
+    if (!(behavior & RenderAsTextDontUpdateLayout) && element->document())
+        element->document()->updateLayout();
+    
+    return externalRepresentation(toRenderBox(renderer), behavior | RenderAsTextShowAllLayers);
 }
 
 static void writeCounterValuesFromChildren(TextStream& stream, RenderObject* parent, bool& isFirstCounter)

Modified: trunk/Source/WebCore/rendering/RenderTreeAsText.h (89229 => 89230)


--- trunk/Source/WebCore/rendering/RenderTreeAsText.h	2011-06-20 04:47:20 UTC (rev 89229)
+++ trunk/Source/WebCore/rendering/RenderTreeAsText.h	2011-06-20 05:08:10 UTC (rev 89230)
@@ -56,6 +56,7 @@
 
 // You don't need pageWidthInPixels if you don't specify RenderAsTextInPrintingMode.
 String externalRepresentation(Frame*, RenderAsTextBehavior = RenderAsTextBehaviorNormal);
+String externalRepresentation(Element*, RenderAsTextBehavior = RenderAsTextBehaviorNormal);
 void write(TextStream&, const RenderObject&, int indent = 0, RenderAsTextBehavior = RenderAsTextBehaviorNormal);
 void writeIndent(TextStream&, int indent);
 

Modified: trunk/Source/WebCore/testing/Internals.cpp (89229 => 89230)


--- trunk/Source/WebCore/testing/Internals.cpp	2011-06-20 04:47:20 UTC (rev 89229)
+++ trunk/Source/WebCore/testing/Internals.cpp	2011-06-20 05:08:10 UTC (rev 89230)
@@ -26,6 +26,9 @@
 #include "config.h"
 #include "Internals.h"
 
+#include "RenderTreeAsText.h"
+#include "ShadowContentElement.h"
+
 namespace WebCore {
 
 PassRefPtr<Internals> Internals::create()
@@ -41,4 +44,30 @@
 {
 }
 
+PassRefPtr<Element> Internals::createShadowContentElement(Document* document, ExceptionCode& ec)
+{
+    if (!document) {
+        ec = INVALID_ACCESS_ERR;
+        return 0;
+    }
+
+    return ShadowContentElement::create(document);
 }
+
+String Internals::elementRenderTreeAsText(Element* element, ExceptionCode& ec)
+{
+    if (!element) {
+        ec = INVALID_ACCESS_ERR;
+        return String();
+    }
+
+    String representation = externalRepresentation(element);
+    if (representation.isEmpty()) {
+        ec = INVALID_ACCESS_ERR;
+        return String();
+    }
+
+    return representation;
+}
+
+}

Modified: trunk/Source/WebCore/testing/Internals.h (89229 => 89230)


--- trunk/Source/WebCore/testing/Internals.h	2011-06-20 04:47:20 UTC (rev 89229)
+++ trunk/Source/WebCore/testing/Internals.h	2011-06-20 05:08:10 UTC (rev 89230)
@@ -26,16 +26,23 @@
 #ifndef Internals_h
 #define Internals_h
 
+#include "ExceptionCode.h"
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
+#include <wtf/text/WTFString.h>
 
 namespace WebCore {
 
+class Document;
+class Element;
+
 class Internals : public RefCounted<Internals> {
 public:
     static PassRefPtr<Internals> create();
     virtual ~Internals();
 
+    PassRefPtr<Element> createShadowContentElement(Document*, ExceptionCode&);
+    String elementRenderTreeAsText(Element*, ExceptionCode&);
 private:
     Internals();
 };

Modified: trunk/Source/WebCore/testing/Internals.idl (89229 => 89230)


--- trunk/Source/WebCore/testing/Internals.idl	2011-06-20 04:47:20 UTC (rev 89229)
+++ trunk/Source/WebCore/testing/Internals.idl	2011-06-20 05:08:10 UTC (rev 89230)
@@ -28,6 +28,8 @@
         LegacyDefaultOptionalArguments,
         OmitConstructor
     ] Internals {
+        Element createShadowContentElement(in Document document) raises(DOMException);
+        DOMString elementRenderTreeAsText(in Element element) raises(DOMException);
     };
 }
 

Modified: trunk/Source/WebKit2/ChangeLog (89229 => 89230)


--- trunk/Source/WebKit2/ChangeLog	2011-06-20 04:47:20 UTC (rev 89229)
+++ trunk/Source/WebKit2/ChangeLog	2011-06-20 05:08:10 UTC (rev 89230)
@@ -1,3 +1,13 @@
+2011-06-19  MORITA Hajime  <morr...@google.com>
+
+        Reviewed by Dimitri Glazkov.
+
+        The internals object should have createShadowContentElement()
+        https://bugs.webkit.org/show_bug.cgi?id=62432
+
+        * win/WebKit2.def: Added some more symbols necessary for
+        window.internals to function to the global symbol list.
+
 2011-06-18  Dimitri Glazkov  <dglaz...@chromium.org>
 
         Reviewed by Darin Adler.

Modified: trunk/Source/WebKit2/win/WebKit2.def (89229 => 89230)


--- trunk/Source/WebKit2/win/WebKit2.def	2011-06-20 04:47:20 UTC (rev 89229)
+++ trunk/Source/WebKit2/win/WebKit2.def	2011-06-20 05:08:10 UTC (rev 89230)
@@ -138,3 +138,10 @@
         ?getCachedDOMStructure@WebCore@@YAPAVStructure@JSC@@PAVJSDOMGlobalObject@1@PBUClassInfo@3@@Z
         ?cacheDOMStructure@WebCore@@YAPAVStructure@JSC@@PAVJSDOMGlobalObject@1@PAV23@PBUClassInfo@3@@Z
         ?virtualFunctionToPreventWeakVtable@JSDOMWrapper@WebCore@@MAEXXZ
+        ?create@ShadowContentElement@WebCore@@SA?AV?$PassRefPtr@VShadowContentElement@WebCore@@@WTF@@PAVDocument@2@@Z
+        ?externalRepresentation@WebCore@@YA?AVString@WTF@@PAVElement@1@I@Z
+        ?setDOMException@WebCore@@YAXPAVExecState@JSC@@H@Z
+        ?toDocument@WebCore@@YAPAVDocument@1@VJSValue@JSC@@@Z
+        ?createWrapper@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@PAVJSDOMGlobalObject@1@PAVNode@1@@Z
+        ?toElement@WebCore@@YAPAVElement@1@VJSValue@JSC@@@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
\ No newline at end of file

Modified: trunk/Source/autotools/symbols.filter (89229 => 89230)


--- trunk/Source/autotools/symbols.filter	2011-06-20 04:47:20 UTC (rev 89229)
+++ trunk/Source/autotools/symbols.filter	2011-06-20 05:08:10 UTC (rev 89230)
@@ -26,9 +26,24 @@
 _ZN3WTF7CStringD1Ev;
 _ZN3WTF7CStringaSERKS0_;
 _ZN24DumpRenderTreeSupportGtk*;
+_ZN7WebCore10JSDocument3putEPN3JSC9ExecStateERKNS1_10IdentifierENS1_7JSValueERNS1_15PutPropertySlotE;
+_ZN7WebCore10JSDocument6s_infoE;
+_ZN7WebCore10toDocumentEN3JSC7JSValueE;
+_ZN7WebCore12JSDOMWrapper34virtualFunctionToPreventWeakVtableEv;
+_ZN7WebCore13createWrapperEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_4NodeE;
+_ZN7WebCore15setDOMExceptionEPN3JSC9ExecStateEi;
+_ZN7WebCore16jsStringSlowCaseEPN3JSC9ExecStateERN3WTF7HashMapIPNS3_10StringImplENS0_4WeakINS0_8JSStringEEENS3_10StringHashENS3_10HashTraitsIS6_EENSB_IS9_EEEES6_;
+_ZN7WebCore17cacheDOMStructureEPNS_17JSDOMGlobalObjectEPN3JSC9StructureEPKNS2_9ClassInfoE;
+_ZN7WebCore20ShadowContentElement6createEPNS_8DocumentE;
 _ZN7WebCore21getCachedDOMStructureEPNS_17JSDOMGlobalObjectEPKN3JSC9ClassInfoE;
-_ZN7WebCore17cacheDOMStructureEPNS_17JSDOMGlobalObjectEPN3JSC9StructureEPKNS2_9ClassInfoE;
-_ZN7WebCore12JSDOMWrapper34virtualFunctionToPreventWeakVtableEv;
+_ZN7WebCore22externalRepresentationEPNS_7ElementEj;
+_ZN7WebCore6JSNode13visitChildrenERN3JSC11SlotVisitorE;
+_ZN7WebCore6JSNode3putEPN3JSC9ExecStateERKNS1_10IdentifierENS1_7JSValueERNS1_15PutPropertySlotE;
+_ZN7WebCore6JSNode6s_infoE;
+_ZN7WebCore9JSElement3putEPN3JSC9ExecStateERKNS1_10IdentifierENS1_7JSValueERNS1_15PutPropertySlotE;
+_ZN7WebCore9JSElement6s_infoE;
+_ZN7WebCore9toElementEN3JSC7JSValueE;
+_ZNK7WebCore6JSNode21pushEventHandlerScopeEPN3JSC9ExecStateEPNS1_14ScopeChainNodeE;
 local:
 _Z*;
 cti*;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to