Changeset 112055 in webkit


Ignore:
Timestamp:
Mar 25, 2012 11:44:15 PM (12 years ago)
Author:
hayato@chromium.org
Message:

[Shadow DOM] Add Reified DOM Tree traversal internal APIs.
https://bugs.webkit.org/show_bug.cgi?id=79197

Reviewed by Dimitri Glazkov.

Add internal APIs which can be used to traverse Reified DOM tree, which is
a result of node distribution algorithm explained in Shadow DOM spec.
https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html

Every public functions defined in ReifiedTreeTraversal are static
functions and are named in a similar way to ones defined in WebCore::Node class.
The only difference is that ReifiedTreeTraversal APIs consider shadow
hosts and also traverse nodes is Shadow DOM subtrees, crossing shadow's upper and lower boundary
transparently.

There is no actual client which uses these APIs. Follow-up patches for FocusNavigation
and EventDispatcher will use the APIs so that they can traverse node in reified tree order.

.:

  • Source/autotools/symbols.filter:

Source/WebCore:

Test: fast/dom/shadow/reified-tree-traversal.html

  • CMakeLists.txt:
  • GNUmakefile.list.am:
  • Target.pri:
  • WebCore.exp.in:
  • WebCore.gypi:
  • WebCore.vcproj/WebCore.vcproj:
  • WebCore.xcodeproj/project.pbxproj:
  • dom/ReifiedTreeTraversal.cpp: Added.

(WebCore):
(WebCore::isShadowHost):
(WebCore::shadowTreeFor):
(WebCore::shadowTreeOfParent):
(WebCore::ReifiedTreeTraversal::firstChild):
(WebCore::ReifiedTreeTraversal::lastChild):
(WebCore::ReifiedTreeTraversal::lastChildWithoutCrossingUpperBoundary):
(WebCore::ReifiedTreeTraversal::traverseChild):
(WebCore::ReifiedTreeTraversal::traverseLightChildren):
(WebCore::ReifiedTreeTraversal::traverseNode):
(WebCore::ReifiedTreeTraversal::nextSibling):
(WebCore::ReifiedTreeTraversal::previousSibling):
(WebCore::ReifiedTreeTraversal::traverseSiblingOrBackToInsertionPoint):
(WebCore::ReifiedTreeTraversal::traverseSiblingInCurrentTree):
(WebCore::ReifiedTreeTraversal::traverseSiblingOrBackToYoungerShadowRoot):
(WebCore::ReifiedTreeTraversal::escapeFallbackContentElement):
(WebCore::ReifiedTreeTraversal::traverseNodeEscapingFallbackContents):
(WebCore::ReifiedTreeTraversal::parentNode):
(WebCore::ReifiedTreeTraversal::parentNodeWithoutCrossingUpperBoundary):
(WebCore::ReifiedTreeTraversal::parentNodeOrBackToInsertionPoint):
(WebCore::ReifiedTreeTraversal::parentNodeInCurrentTree):
(WebCore::ReifiedTreeTraversal::parentNodeBackToYoungerShadowRootOrHost):
(WebCore::ReifiedTreeTraversal::adjustedParentNode):
(WebCore::ReifiedTreeTraversal::traverseNextNode):
(WebCore::ReifiedTreeTraversal::traverseNextNodeWithoutCrossingUpperBoundary):
(WebCore::ReifiedTreeTraversal::traversePreviousNode):
(WebCore::ReifiedTreeTraversal::traversePreviousNodeWithoutCrossingUpperBoundary):

  • dom/ReifiedTreeTraversal.h: Added.

(WebCore):
(ReifiedTreeTraversal):

  • dom/ShadowTree.cpp:

(WebCore::ShadowTree::insertionPointFor):
(WebCore::ShadowTree::selectionFor):
(WebCore):

  • dom/ShadowTree.h:

(WebCore):
(ShadowTree):

  • html/shadow/HTMLContentSelector.cpp:

(WebCore::HTMLContentSelector::findFor):

  • html/shadow/HTMLContentSelector.h:

(HTMLContentSelectionSet):
(WebCore::HTMLContentSelectionSet::find):
(HTMLContentSelector):

  • html/shadow/InsertionPoint.h:

(WebCore::isInsertionPoint):
(WebCore::toInsertionPoint):
(WebCore):

  • testing/Internals.cpp:

(WebCore::Internals::nextSiblingInReifiedTree):
(WebCore):
(WebCore::Internals::firstChildInReifiedTree):
(WebCore::Internals::lastChildInReifiedTree):
(WebCore::Internals::traverseNextNodeInReifiedTree):
(WebCore::Internals::traversePreviousNodeInReifiedTree):

  • testing/Internals.h:

(Internals):

  • testing/Internals.idl:

Source/WebKit2:

  • win/WebKit2.def:
  • win/WebKit2CFLite.def:

LayoutTests:

  • fast/dom/shadow/reified-tree-traversal-expected.txt: Added.
  • fast/dom/shadow/reified-tree-traversal.html: Added.
  • platform/efl/Skipped:
  • platform/qt/Skipped:
  • platform/win/Skipped:
  • platform/wincairo/Skipped:
  • platform/wk2/Skipped:
Location:
trunk
Files:
4 added
27 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r112048 r112055  
     12012-03-25  Hayato Ito  <hayato@chromium.org>
     2
     3        [Shadow DOM] Add Reified DOM Tree traversal internal APIs.
     4        https://bugs.webkit.org/show_bug.cgi?id=79197
     5
     6        Reviewed by Dimitri Glazkov.
     7
     8        Add internal APIs which can be used to traverse Reified DOM tree, which is
     9        a result of node distribution algorithm explained in Shadow DOM spec.
     10        https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html
     11
     12        Every public functions defined in ReifiedTreeTraversal are static
     13        functions and are named in a similar way to ones defined in WebCore::Node class.
     14        The only difference is that ReifiedTreeTraversal APIs consider shadow
     15        hosts and also traverse nodes is Shadow DOM subtrees, crossing shadow's upper and lower boundary
     16        transparently.
     17
     18        There is no actual client which uses these APIs. Follow-up patches for FocusNavigation
     19        and EventDispatcher will use the APIs so that they can traverse node in reified tree order.
     20
     21        * Source/autotools/symbols.filter:
     22
    1232012-03-25  Kevin Ollivier  <kevino@theolliviers.com>
    224
  • trunk/LayoutTests/ChangeLog

    r112054 r112055  
     12012-03-25  Hayato Ito  <hayato@chromium.org>
     2
     3        [Shadow DOM] Add Reified DOM Tree traversal internal APIs.
     4        https://bugs.webkit.org/show_bug.cgi?id=79197
     5
     6        Reviewed by Dimitri Glazkov.
     7
     8        Add internal APIs which can be used to traverse Reified DOM tree, which is
     9        a result of node distribution algorithm explained in Shadow DOM spec.
     10        https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html
     11
     12        Every public functions defined in ReifiedTreeTraversal are static
     13        functions and are named in a similar way to ones defined in WebCore::Node class.
     14        The only difference is that ReifiedTreeTraversal APIs consider shadow
     15        hosts and also traverse nodes is Shadow DOM subtrees, crossing shadow's upper and lower boundary
     16        transparently.
     17
     18        There is no actual client which uses these APIs. Follow-up patches for FocusNavigation
     19        and EventDispatcher will use the APIs so that they can traverse node in reified tree order.
     20
     21        * fast/dom/shadow/reified-tree-traversal-expected.txt: Added.
     22        * fast/dom/shadow/reified-tree-traversal.html: Added.
     23        * platform/efl/Skipped:
     24        * platform/qt/Skipped:
     25        * platform/win/Skipped:
     26        * platform/wincairo/Skipped:
     27        * platform/wk2/Skipped:
     28
    1292012-03-25  Csaba Osztrogonác  <ossy@webkit.org>
    230
  • trunk/LayoutTests/platform/efl/Skipped

    r112045 r112055  
    18871887fast/dom/shadow/content-element-in-meter-element.html
    18881888fast/dom/shadow/get-element-by-id-in-shadow-root.html
     1889fast/dom/shadow/reified-tree-traversal.html
    18891890fast/dom/shadow/shadow-root-js-api.html
    18901891fast/dom/shadow/shadow-disable.html
  • trunk/LayoutTests/platform/qt/Skipped

    r112054 r112055  
    175175fast/dom/shadow/multiple-shadowroot-rendering.html
    176176fast/dom/shadow/multiple-shadowroot-adopt.html
     177fast/dom/shadow/reified-tree-traversal.html
    177178fast/dom/shadow/shadow-boundary-events.html
    178179fast/dom/shadow/shadow-content-crash.html
  • trunk/LayoutTests/platform/win/Skipped

    r111919 r112055  
    14701470fast/dom/shadow/content-element-in-meter-element.html
    14711471fast/dom/shadow/get-element-by-id-in-shadow-root.html
     1472fast/dom/shadow/reified-tree-traversal.html
    14721473fast/dom/shadow/shadow-root-js-api.html
    14731474fast/dom/shadow/shadow-disable.html
  • trunk/LayoutTests/platform/wincairo/Skipped

    r111637 r112055  
    19801980fast/dom/shadow/content-element-in-meter-element.html
    19811981fast/dom/shadow/get-element-by-id-in-shadow-root.html
     1982fast/dom/shadow/reified-tree-traversal.html
    19821983fast/dom/shadow/shadow-root-js-api.html
    19831984fast/dom/shadow/shadow-disable.html
  • trunk/LayoutTests/platform/wk2/Skipped

    r111500 r112055  
    10861086fast/dom/shadow/content-element-in-media-element.html
    10871087fast/dom/shadow/content-element-in-meter-element.html
     1088fast/dom/shadow/reified-tree-traversal.html
    10881089fast/dom/shadow/shadow-root-js-api.html
    10891090fast/dom/shadow/shadow-disable.html
  • trunk/Source/WebCore/CMakeLists.txt

    r112035 r112055  
    616616    dom/RangeException.cpp
    617617    dom/RegisteredEventListener.cpp
     618    dom/ReifiedTreeTraversal.cpp
    618619    dom/ScopedEventQueue.cpp
    619620    dom/ScriptableDocumentParser.cpp
  • trunk/Source/WebCore/ChangeLog

    r112053 r112055  
     12012-03-25  Hayato Ito  <hayato@chromium.org>
     2
     3        [Shadow DOM] Add Reified DOM Tree traversal internal APIs.
     4        https://bugs.webkit.org/show_bug.cgi?id=79197
     5
     6        Reviewed by Dimitri Glazkov.
     7
     8        Add internal APIs which can be used to traverse Reified DOM tree, which is
     9        a result of node distribution algorithm explained in Shadow DOM spec.
     10        https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html
     11
     12        Every public functions defined in ReifiedTreeTraversal are static
     13        functions and are named in a similar way to ones defined in WebCore::Node class.
     14        The only difference is that ReifiedTreeTraversal APIs consider shadow
     15        hosts and also traverse nodes is Shadow DOM subtrees, crossing shadow's upper and lower boundary
     16        transparently.
     17
     18        There is no actual client which uses these APIs. Follow-up patches for FocusNavigation
     19        and EventDispatcher will use the APIs so that they can traverse node in reified tree order.
     20
     21        Test: fast/dom/shadow/reified-tree-traversal.html
     22
     23        * CMakeLists.txt:
     24        * GNUmakefile.list.am:
     25        * Target.pri:
     26        * WebCore.exp.in:
     27        * WebCore.gypi:
     28        * WebCore.vcproj/WebCore.vcproj:
     29        * WebCore.xcodeproj/project.pbxproj:
     30        * dom/ReifiedTreeTraversal.cpp: Added.
     31        (WebCore):
     32        (WebCore::isShadowHost):
     33        (WebCore::shadowTreeFor):
     34        (WebCore::shadowTreeOfParent):
     35        (WebCore::ReifiedTreeTraversal::firstChild):
     36        (WebCore::ReifiedTreeTraversal::lastChild):
     37        (WebCore::ReifiedTreeTraversal::lastChildWithoutCrossingUpperBoundary):
     38        (WebCore::ReifiedTreeTraversal::traverseChild):
     39        (WebCore::ReifiedTreeTraversal::traverseLightChildren):
     40        (WebCore::ReifiedTreeTraversal::traverseNode):
     41        (WebCore::ReifiedTreeTraversal::nextSibling):
     42        (WebCore::ReifiedTreeTraversal::previousSibling):
     43        (WebCore::ReifiedTreeTraversal::traverseSiblingOrBackToInsertionPoint):
     44        (WebCore::ReifiedTreeTraversal::traverseSiblingInCurrentTree):
     45        (WebCore::ReifiedTreeTraversal::traverseSiblingOrBackToYoungerShadowRoot):
     46        (WebCore::ReifiedTreeTraversal::escapeFallbackContentElement):
     47        (WebCore::ReifiedTreeTraversal::traverseNodeEscapingFallbackContents):
     48        (WebCore::ReifiedTreeTraversal::parentNode):
     49        (WebCore::ReifiedTreeTraversal::parentNodeWithoutCrossingUpperBoundary):
     50        (WebCore::ReifiedTreeTraversal::parentNodeOrBackToInsertionPoint):
     51        (WebCore::ReifiedTreeTraversal::parentNodeInCurrentTree):
     52        (WebCore::ReifiedTreeTraversal::parentNodeBackToYoungerShadowRootOrHost):
     53        (WebCore::ReifiedTreeTraversal::adjustedParentNode):
     54        (WebCore::ReifiedTreeTraversal::traverseNextNode):
     55        (WebCore::ReifiedTreeTraversal::traverseNextNodeWithoutCrossingUpperBoundary):
     56        (WebCore::ReifiedTreeTraversal::traversePreviousNode):
     57        (WebCore::ReifiedTreeTraversal::traversePreviousNodeWithoutCrossingUpperBoundary):
     58        * dom/ReifiedTreeTraversal.h: Added.
     59        (WebCore):
     60        (ReifiedTreeTraversal):
     61        * dom/ShadowTree.cpp:
     62        (WebCore::ShadowTree::insertionPointFor):
     63        (WebCore::ShadowTree::selectionFor):
     64        (WebCore):
     65        * dom/ShadowTree.h:
     66        (WebCore):
     67        (ShadowTree):
     68        * html/shadow/HTMLContentSelector.cpp:
     69        (WebCore::HTMLContentSelector::findFor):
     70        * html/shadow/HTMLContentSelector.h:
     71        (HTMLContentSelectionSet):
     72        (WebCore::HTMLContentSelectionSet::find):
     73        (HTMLContentSelector):
     74        * html/shadow/InsertionPoint.h:
     75        (WebCore::isInsertionPoint):
     76        (WebCore::toInsertionPoint):
     77        (WebCore):
     78        * testing/Internals.cpp:
     79        (WebCore::Internals::nextSiblingInReifiedTree):
     80        (WebCore):
     81        (WebCore::Internals::firstChildInReifiedTree):
     82        (WebCore::Internals::lastChildInReifiedTree):
     83        (WebCore::Internals::traverseNextNodeInReifiedTree):
     84        (WebCore::Internals::traversePreviousNodeInReifiedTree):
     85        * testing/Internals.h:
     86        (Internals):
     87        * testing/Internals.idl:
     88
    1892012-03-25  Nikita Vasilyev  <me@elv1s.ru>
    290
  • trunk/Source/WebCore/GNUmakefile.list.am

    r112035 r112055  
    19201920        Source/WebCore/dom/RegisteredEventListener.cpp \
    19211921        Source/WebCore/dom/RegisteredEventListener.h \
     1922        Source/WebCore/dom/ReifiedTreeTraversal.cpp \
     1923        Source/WebCore/dom/ReifiedTreeTraversal.h \
    19221924        Source/WebCore/dom/RenderedDocumentMarker.h \
    19231925        Source/WebCore/dom/ScopedEventQueue.cpp \
  • trunk/Source/WebCore/Target.pri

    r112035 r112055  
    593593    dom/RawDataDocumentParser.h \
    594594    dom/RegisteredEventListener.cpp \
     595    dom/ReifiedTreeTraversal.cpp \
    595596    dom/ScopedEventQueue.cpp \
    596597    dom/ScriptedAnimationController.cpp \
     
    17221723    dom/Range.h \
    17231724    dom/RegisteredEventListener.h \
     1725    dom/ReifiedTreeTraversal.h \
    17241726    dom/RenderedDocumentMarker.h \
    17251727    dom/ScriptedAnimationController.h \
  • trunk/Source/WebCore/WebCore.exp.in

    r111890 r112055  
    608608__ZN7WebCore20PlatformEventFactory24createPlatformMouseEventEP7NSEventP6NSView
    609609__ZN7WebCore20PlatformEventFactory27createPlatformKeyboardEventEP7NSEvent
     610__ZN7WebCore20ReifiedTreeTraversal11nextSiblingEPKNS_4NodeE
     611__ZN7WebCore20ReifiedTreeTraversal20traversePreviousNodeEPKNS_4NodeE
     612__ZN7WebCore20ReifiedTreeTraversal9lastChildEPKNS_4NodeE
     613__ZN7WebCore20ReifiedTreeTraversal16traverseNextNodeEPKNS_4NodeE
     614__ZN7WebCore20ReifiedTreeTraversal10firstChildEPKNS_4NodeE
    610615__ZN7WebCore20RenderEmbeddedObject30setShowsCrashedPluginIndicatorEv
    611616__ZN7WebCore20ResourceResponseBase11setMimeTypeERKN3WTF6StringE
  • trunk/Source/WebCore/WebCore.gypi

    r112035 r112055  
    626626            'dom/RangeBoundaryPoint.h',
    627627            'dom/RegisteredEventListener.h',
     628            'dom/ReifiedTreeTraversal.h',
    628629            'dom/RenderedDocumentMarker.h',
    629630            'dom/ScriptExecutionContext.h',
     
    52175218            'dom/RawDataDocumentParser.h',
    52185219            'dom/RegisteredEventListener.cpp',
     5220            'dom/ReifiedTreeTraversal.cpp',
     5221            'dom/ReifiedTreeTraversal.h',
    52195222            'dom/RequestAnimationFrameCallback.h',
    52205223            'dom/ScopedEventQueue.cpp',
  • trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj

    r112035 r112055  
    5190351903                        </File>
    5190451904                        <File
     51905                                RelativePath="..\dom\ReifiedTreeTraversal.cpp"
     51906                                >
     51907                        </File>
     51908                        <File
     51909                                RelativePath="..\dom\ReifiedTreeTraversal.h"
     51910                                >
     51911                        </File>
     51912                        <File
    5190551913                                RelativePath="..\dom\RegisteredEventListener.cpp"
    5190651914                                >
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r112035 r112055  
    13561356                49FFBF3F11C93EE3006A7118 /* WebGLLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 49FFBF3D11C93EE3006A7118 /* WebGLLayer.h */; };
    13571357                49FFBF4011C93EE3006A7118 /* WebGLLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 49FFBF3E11C93EE3006A7118 /* WebGLLayer.mm */; };
     1358                4A013D291512FD7700E1E613 /* ReifiedTreeTraversal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A013D271512FD7700E1E613 /* ReifiedTreeTraversal.cpp */; };
     1359                4A013D2A1512FD7700E1E613 /* ReifiedTreeTraversal.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A013D281512FD7700E1E613 /* ReifiedTreeTraversal.h */; };
    13581360                4A0DA2FE129B241900AB61E1 /* FormAssociatedElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A0DA2FC129B241900AB61E1 /* FormAssociatedElement.cpp */; };
    13591361                4A0DA2FF129B241900AB61E1 /* FormAssociatedElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A0DA2FD129B241900AB61E1 /* FormAssociatedElement.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    82968298                49FFBF3D11C93EE3006A7118 /* WebGLLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebGLLayer.h; sourceTree = "<group>"; };
    82978299                49FFBF3E11C93EE3006A7118 /* WebGLLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebGLLayer.mm; sourceTree = "<group>"; };
     8300                4A013D271512FD7700E1E613 /* ReifiedTreeTraversal.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ReifiedTreeTraversal.cpp; sourceTree = "<group>"; };
     8301                4A013D281512FD7700E1E613 /* ReifiedTreeTraversal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReifiedTreeTraversal.h; sourceTree = "<group>"; };
    82988302                4A0DA2FC129B241900AB61E1 /* FormAssociatedElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FormAssociatedElement.cpp; sourceTree = "<group>"; };
    82998303                4A0DA2FD129B241900AB61E1 /* FormAssociatedElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FormAssociatedElement.h; sourceTree = "<group>"; };
     
    2108121085                                85031B350A44EFC700F992E0 /* RegisteredEventListener.cpp */,
    2108221086                                85031B360A44EFC700F992E0 /* RegisteredEventListener.h */,
     21087                                4A013D271512FD7700E1E613 /* ReifiedTreeTraversal.cpp */,
     21088                                4A013D281512FD7700E1E613 /* ReifiedTreeTraversal.h */,
    2108321089                                A76E5F7E135E0DCF00A69837 /* RenderedDocumentMarker.h */,
    2108421090                                4998AEC413F9D0EA0090B1AA /* RequestAnimationFrameCallback.h */,
     
    2378423790                                85031B4C0A44EFC700F992E0 /* RegisteredEventListener.h in Headers */,
    2378523791                                B2C3DA2D0D006C1D00EF6F26 /* RegularExpression.h in Headers */,
     23792                                4A013D2A1512FD7700E1E613 /* ReifiedTreeTraversal.h in Headers */,
    2378623793                                93309E01099E64920056E581 /* RemoveCSSPropertyCommand.h in Headers */,
    2378723794                                D06C0D8F0CFD11460065F43F /* RemoveFormatCommand.h in Headers */,
     
    2693426941                                85031B4B0A44EFC700F992E0 /* RegisteredEventListener.cpp in Sources */,
    2693526942                                B2C3DA2C0D006C1D00EF6F26 /* RegularExpression.cpp in Sources */,
     26943                                4A013D291512FD7700E1E613 /* ReifiedTreeTraversal.cpp in Sources */,
    2693626944                                93309E00099E64920056E581 /* RemoveCSSPropertyCommand.cpp in Sources */,
    2693726945                                D06C0D900CFD11460065F43F /* RemoveFormatCommand.cpp in Sources */,
  • trunk/Source/WebCore/dom/ShadowTree.cpp

    r111155 r112055  
    205205}
    206206
    207 InsertionPoint* ShadowTree::insertionPointFor(Node* node) const
     207InsertionPoint* ShadowTree::insertionPointFor(const Node* node) const
    208208{
    209209    ASSERT(node && node->parentNode());
     
    220220        return 0;
    221221    return found->insertionPoint();
     222}
     223
     224HTMLContentSelection* ShadowTree::selectionFor(const Node* node) const
     225{
     226    return m_selector.findFor(node);
    222227}
    223228
  • trunk/Source/WebCore/dom/ShadowTree.h

    r110935 r112055  
    4242class InsertionPoint;
    4343class TreeScope;
     44class HTMLContentSelection;
    4445
    4546class ShadowTree {
     
    8081    void hostChildrenChanged();
    8182
    82     InsertionPoint* insertionPointFor(Node*) const;
     83    InsertionPoint* insertionPointFor(const Node*) const;
     84    HTMLContentSelection* selectionFor(const Node*) const;
    8385
    8486    HTMLContentSelector& selector();
  • trunk/Source/WebCore/html/shadow/HTMLContentSelector.cpp

    r110935 r112055  
    139139}
    140140
    141 HTMLContentSelection* HTMLContentSelector::findFor(Node* key) const
     141HTMLContentSelection* HTMLContentSelector::findFor(const Node* key) const
    142142{
    143143    return m_selectionSet.find(key);
  • trunk/Source/WebCore/html/shadow/HTMLContentSelector.h

    r110935 r112055  
    9999    void remove(HTMLContentSelection* value) { m_set.remove(value); }
    100100    bool isEmpty() const { return m_set.isEmpty(); }
    101     HTMLContentSelection* find(Node* key) const;
     101    HTMLContentSelection* find(const Node* key) const;
    102102
    103103private:
     
    119119};
    120120
    121 inline HTMLContentSelection* HTMLContentSelectionSet::find(Node* key) const
     121inline HTMLContentSelection* HTMLContentSelectionSet::find(const Node* key) const
    122122{
    123     PointerSet::iterator found = m_set.find<Node*, HTMLContentSelectionSet::Translator>(key);
     123    PointerSet::iterator found = m_set.find<const Node*, HTMLContentSelectionSet::Translator>(key);
    124124    return found != m_set.end() ? *found : 0;
    125125}
     
    133133    void select(InsertionPoint*, HTMLContentSelectionList*);
    134134    void unselect(HTMLContentSelectionList*);
    135     HTMLContentSelection* findFor(Node* key) const;
     135    HTMLContentSelection* findFor(const Node* key) const;
    136136
    137137    void willSelect();
  • trunk/Source/WebCore/html/shadow/InsertionPoint.h

    r110161 r112055  
    7272};
    7373
    74 inline bool isInsertionPoint(Node* node)
     74inline bool isInsertionPoint(const Node* node)
    7575{
    7676    if (!node)
     
    8989}
    9090
     91inline const InsertionPoint* toInsertionPoint(const Node* node)
     92{
     93    ASSERT(isInsertionPoint(node));
     94    return static_cast<const InsertionPoint*>(node);
     95}
     96
    9197inline bool isShadowBoundary(Node* node)
    9298{
  • trunk/Source/WebCore/testing/Internals.cpp

    r111890 r112055  
    5151#include "Page.h"
    5252#include "Range.h"
     53#include "ReifiedTreeTraversal.h"
    5354#include "RenderObject.h"
    5455#include "RenderTreeAsText.h"
     
    182183}
    183184
     185Node* Internals::nextSiblingInReifiedTree(Node* node, ExceptionCode& ec)
     186{
     187    if (!node) {
     188        ec = INVALID_ACCESS_ERR;
     189        return 0;
     190    }
     191    return ReifiedTreeTraversal::nextSibling(node);
     192}
     193
     194Node* Internals::firstChildInReifiedTree(Node* node, ExceptionCode& ec)
     195{
     196    if (!node) {
     197        ec = INVALID_ACCESS_ERR;
     198        return 0;
     199    }
     200    return ReifiedTreeTraversal::firstChild(node);
     201}
     202
     203Node* Internals::lastChildInReifiedTree(Node* node, ExceptionCode& ec)
     204{
     205    if (!node) {
     206        ec = INVALID_ACCESS_ERR;
     207        return 0;
     208    }
     209    return ReifiedTreeTraversal::lastChild(node);
     210}
     211
     212Node* Internals::traverseNextNodeInReifiedTree(Node* node, ExceptionCode& ec)
     213{
     214    if (!node) {
     215        ec = INVALID_ACCESS_ERR;
     216        return 0;
     217    }
     218    return ReifiedTreeTraversal::traverseNextNode(node);
     219}
     220
     221Node* Internals::traversePreviousNodeInReifiedTree(Node* node, ExceptionCode& ec)
     222{
     223    if (!node) {
     224        ec = INVALID_ACCESS_ERR;
     225        return 0;
     226    }
     227    return ReifiedTreeTraversal::traversePreviousNode(node);
     228}
     229
    184230String Internals::elementRenderTreeAsText(Element* element, ExceptionCode& ec)
    185231{
  • trunk/Source/WebCore/testing/Internals.h

    r111890 r112055  
    8585    bool attached(Node*, ExceptionCode&);
    8686
     87    Node* nextSiblingInReifiedTree(Node*, ExceptionCode&);
     88    Node* firstChildInReifiedTree(Node*, ExceptionCode&);
     89    Node* lastChildInReifiedTree(Node*, ExceptionCode&);
     90    Node* traverseNextNodeInReifiedTree(Node*, ExceptionCode&);
     91    Node* traversePreviousNodeInReifiedTree(Node*, ExceptionCode&);
     92
    8793#if ENABLE(INPUT_COLOR)
    8894    void selectColorInColorChooser(Element*, const String& colorValue);
  • trunk/Source/WebCore/testing/Internals.idl

    r111890 r112055  
    5555        Element getElementByIdInShadowRoot(in Node shadowRoot, in DOMString id) raises(DOMException);
    5656        boolean isValidContentSelect(in Element contentElement) raises(DOMException);
     57
     58        Node nextSiblingInReifiedTree(in Node node) raises(DOMException);
     59        Node firstChildInReifiedTree(in Node node) raises(DOMException);
     60        Node lastChildInReifiedTree(in Node node) raises(DOMException);
     61        Node traverseNextNodeInReifiedTree(in Node node) raises(DOMException);
     62        Node traversePreviousNodeInReifiedTree(in Node node) raises(DOMException);
    5763
    5864        boolean attached(in Node node) raises(DOMException);
  • trunk/Source/WebKit2/ChangeLog

    r112033 r112055  
     12012-03-25  Hayato Ito  <hayato@chromium.org>
     2
     3        [Shadow DOM] Add Reified DOM Tree traversal internal APIs.
     4        https://bugs.webkit.org/show_bug.cgi?id=79197
     5
     6        Reviewed by Dimitri Glazkov.
     7
     8        Add internal APIs which can be used to traverse Reified DOM tree, which is
     9        a result of node distribution algorithm explained in Shadow DOM spec.
     10        https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html
     11
     12        Every public functions defined in ReifiedTreeTraversal are static
     13        functions and are named in a similar way to ones defined in WebCore::Node class.
     14        The only difference is that ReifiedTreeTraversal APIs consider shadow
     15        hosts and also traverse nodes is Shadow DOM subtrees, crossing shadow's upper and lower boundary
     16        transparently.
     17
     18        There is no actual client which uses these APIs. Follow-up patches for FocusNavigation
     19        and EventDispatcher will use the APIs so that they can traverse node in reified tree order.
     20
     21        * win/WebKit2.def:
     22        * win/WebKit2CFLite.def:
     23
    1242012-03-25  Alexander Færøy  <alexander.faeroy@nokia.com>
    225
  • trunk/Source/WebKit2/win/WebKit2.def

    r111890 r112055  
    169169        ?externalRepresentation@WebCore@@YA?AVString@WTF@@PAVElement@1@I@Z
    170170        ?find@StringImpl@WTF@@QAEIPAV12@I@Z
     171        ?firstChild@ReifiedTreeTraversal@WebCore@@SAPAVNode@2@PBV32@@Z
    171172        ?frameDestroyed@FrameDestructionObserver@WebCore@@UAEXXZ
    172173        ?fromUTF8WithLatin1Fallback@String@WTF@@SA?AV12@PBEI@Z
     
    181182        ?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
    182183        ?lastChangeWasUserEdit@HTMLTextFormControlElement@WebCore@@QBE_NXZ
     184        ?lastChild@ReifiedTreeTraversal@WebCore@@SAPAVNode@2@PBV32@@Z
    183185        ?markersFor@DocumentMarkerController@WebCore@@QAE?AV?$Vector@PAVDocumentMarker@WebCore@@$0A@@WTF@@PAVNode@2@VMarkerTypes@DocumentMarker@2@@Z
     186        ?nextSibling@ReifiedTreeTraversal@WebCore@@SAPAVNode@2@PBV32@@Z
    184187        ?number@String@WTF@@SA?AV12@I@Z
    185188        ?number@String@WTF@@SA?AV12@H@Z
     
    228231        ?toJS@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@PAVJSDOMGlobalObject@1@PAVNodeList@1@@Z
    229232        ?toRange@WebCore@@YAPAVRange@1@VJSValue@JSC@@@Z
     233        ?traverseNextNode@ReifiedTreeTraversal@WebCore@@SAPAVNode@2@PBV32@@Z
     234        ?traversePreviousNode@ReifiedTreeTraversal@WebCore@@SAPAVNode@2@PBV32@@Z
    230235        ?updateLayoutIgnorePendingStylesheets@Document@WebCore@@QAEXXZ
    231236        ?userPreferredLanguages@WebCore@@YA?AV?$Vector@VString@WTF@@$0A@@WTF@@XZ
  • trunk/Source/WebKit2/win/WebKit2CFLite.def

    r111911 r112055  
    162162        ?externalRepresentation@WebCore@@YA?AVString@WTF@@PAVElement@1@I@Z
    163163        ?find@StringImpl@WTF@@QAEIPAV12@I@Z
     164        ?firstChild@ReifiedTreeTraversal@WebCore@@SAPAVNode@2@PBV32@@Z
    164165        ?frameDestroyed@FrameDestructionObserver@WebCore@@UAEXXZ
    165166        ?fromUTF8WithLatin1Fallback@String@WTF@@SA?AV12@PBEI@Z
     
    174175        ?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
    175176        ?lastChangeWasUserEdit@HTMLTextFormControlElement@WebCore@@QBE_NXZ
     177        ?lastChild@ReifiedTreeTraversal@WebCore@@SAPAVNode@2@PBV32@@Z
    176178        ?markersFor@DocumentMarkerController@WebCore@@QAE?AV?$Vector@PAVDocumentMarker@WebCore@@$0A@@WTF@@PAVNode@2@VMarkerTypes@DocumentMarker@2@@Z
    177179        ?number@String@WTF@@SA?AV12@I@Z
     
    179181        ?observeFrame@FrameDestructionObserver@WebCore@@IAEXPAVFrame@2@@Z
    180182        ?overrideUserPreferredLanguages@WebCore@@YAXABV?$Vector@VString@WTF@@$0A@@WTF@@@Z
     183        ?nextSibling@ReifiedTreeTraversal@WebCore@@SAPAVNode@2@PBV32@@Z
    181184        ?numberOfScopedHTMLStyleChildren@Node@WebCore@@QBEIXZ
    182185        ?page@Document@WebCore@@QBEPAVPage@2@XZ
     
    221224        ?toJS@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@PAVJSDOMGlobalObject@1@PAVNodeList@1@@Z
    222225        ?toRange@WebCore@@YAPAVRange@1@VJSValue@JSC@@@Z
     226        ?traverseNextNode@ReifiedTreeTraversal@WebCore@@SAPAVNode@2@PBV32@@Z
     227        ?traversePreviousNode@ReifiedTreeTraversal@WebCore@@SAPAVNode@2@PBV32@@Z
    223228        ?updateLayoutIgnorePendingStylesheets@Document@WebCore@@QAEXXZ
    224229        ?userPreferredLanguages@WebCore@@YA?AV?$Vector@VString@WTF@@$0A@@WTF@@XZ
  • trunk/Source/autotools/symbols.filter

    r111890 r112055  
    6565_ZN7WebCore20NodeRenderingContextC1EPNS_4NodeE;
    6666_ZN7WebCore20NodeRenderingContextD1Ev;
     67_ZN7WebCore20ReifiedTreeTraversal11nextSiblingEPKNS_4NodeE;
     68_ZN7WebCore20ReifiedTreeTraversal20traversePreviousNodeEPKNS_4NodeE;
     69_ZN7WebCore20ReifiedTreeTraversal9lastChildEPKNS_4NodeE;
     70_ZN7WebCore20ReifiedTreeTraversal16traverseNextNodeEPKNS_4NodeE;
     71_ZN7WebCore20ReifiedTreeTraversal10firstChildEPKNS_4NodeE;
    6772_ZN7WebCore21getCachedDOMStructureEPNS_17JSDOMGlobalObjectEPKN3JSC9ClassInfoE;
    6873_ZN7WebCore22externalRepresentationEPNS_7ElementEj;
Note: See TracChangeset for help on using the changeset viewer.