Changeset 123412 in webkit


Ignore:
Timestamp:
Jul 23, 2012 5:53:24 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Unreviewed, rolling out r123184, r123195, and r123197.
http://trac.webkit.org/changeset/123184
http://trac.webkit.org/changeset/123195
http://trac.webkit.org/changeset/123197
https://bugs.webkit.org/show_bug.cgi?id=92049

pagecycler regression (Requested by morrita on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-07-23

.:

  • Source/autotools/symbols.filter:

Source/WebCore:

  • WebCore.exp.in:
  • dom/Document.cpp:

(WebCore::Document::Document):
(WebCore::Document::~Document):
(WebCore::Document::suggestedMIMEType):

  • dom/Document.h:

(WebCore):
(WebCore::Node::isDocumentNode):
(WebCore::Node::Node):

  • dom/Node.cpp:

(WebCore::Node::~Node):
(WebCore::Node::setDocument):
(WebCore):
(WebCore::Node::setTreeScope):
(WebCore::Node::treeScope):
(WebCore::Node::isInShadowTree):
(WebCore::Node::reportMemoryUsage):

  • dom/Node.h:

(Node):
(WebCore::Node::document):
(WebCore::Node::inDocument):

  • dom/NodeRareData.h:

(WebCore::NodeRareData::NodeRareData):
(WebCore::NodeRareData::treeScope):
(WebCore::NodeRareData::setTreeScope):
(NodeRareData):

  • dom/ShadowRoot.cpp:

(WebCore::ShadowRoot::ShadowRoot):

  • dom/TreeScope.cpp:

(WebCore::TreeScope::TreeScope):
(WebCore::TreeScope::setParentTreeScope):

  • dom/TreeScope.h:

(WebCore):
(WebCore::TreeScope::idTargetObserverRegistry):
(TreeScope):

  • dom/TreeScopeAdopter.cpp:

(WebCore::TreeScopeAdopter::moveTreeToNewScope):
(WebCore::TreeScopeAdopter::moveNodeToNewDocument):

  • editing/MoveSelectionCommand.cpp:
  • editing/RemoveNodeCommand.cpp:
  • editing/RemoveNodePreservingChildrenCommand.cpp:
  • inspector/PageConsoleAgent.cpp:

Source/WebKit2:

  • win/WebKit2.def:
  • win/WebKit2CFLite.def:
Location:
trunk
Files:
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r123411 r123412  
     12012-07-23  Sheriff Bot  <webkit.review.bot@gmail.com>
     2
     3        Unreviewed, rolling out r123184, r123195, and r123197.
     4        http://trac.webkit.org/changeset/123184
     5        http://trac.webkit.org/changeset/123195
     6        http://trac.webkit.org/changeset/123197
     7        https://bugs.webkit.org/show_bug.cgi?id=92049
     8
     9        pagecycler regression (Requested by morrita on #webkit).
     10
     11        * Source/autotools/symbols.filter:
     12
    1132012-07-23  Roger Fong  <roger_fong@apple.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r123411 r123412  
     12012-07-23  Sheriff Bot  <webkit.review.bot@gmail.com>
     2
     3        Unreviewed, rolling out r123184, r123195, and r123197.
     4        http://trac.webkit.org/changeset/123184
     5        http://trac.webkit.org/changeset/123195
     6        http://trac.webkit.org/changeset/123197
     7        https://bugs.webkit.org/show_bug.cgi?id=92049
     8
     9        pagecycler regression (Requested by morrita on #webkit).
     10
     11        * WebCore.exp.in:
     12        * dom/Document.cpp:
     13        (WebCore::Document::Document):
     14        (WebCore::Document::~Document):
     15        (WebCore::Document::suggestedMIMEType):
     16        * dom/Document.h:
     17        (WebCore):
     18        (WebCore::Node::isDocumentNode):
     19        (WebCore::Node::Node):
     20        * dom/Node.cpp:
     21        (WebCore::Node::~Node):
     22        (WebCore::Node::setDocument):
     23        (WebCore):
     24        (WebCore::Node::setTreeScope):
     25        (WebCore::Node::treeScope):
     26        (WebCore::Node::isInShadowTree):
     27        (WebCore::Node::reportMemoryUsage):
     28        * dom/Node.h:
     29        (Node):
     30        (WebCore::Node::document):
     31        (WebCore::Node::inDocument):
     32        * dom/NodeRareData.h:
     33        (WebCore::NodeRareData::NodeRareData):
     34        (WebCore::NodeRareData::treeScope):
     35        (WebCore::NodeRareData::setTreeScope):
     36        (NodeRareData):
     37        * dom/ShadowRoot.cpp:
     38        (WebCore::ShadowRoot::ShadowRoot):
     39        * dom/TreeScope.cpp:
     40        (WebCore::TreeScope::TreeScope):
     41        (WebCore::TreeScope::setParentTreeScope):
     42        * dom/TreeScope.h:
     43        (WebCore):
     44        (WebCore::TreeScope::idTargetObserverRegistry):
     45        (TreeScope):
     46        * dom/TreeScopeAdopter.cpp:
     47        (WebCore::TreeScopeAdopter::moveTreeToNewScope):
     48        (WebCore::TreeScopeAdopter::moveNodeToNewDocument):
     49        * editing/MoveSelectionCommand.cpp:
     50        * editing/RemoveNodeCommand.cpp:
     51        * editing/RemoveNodePreservingChildrenCommand.cpp:
     52        * inspector/PageConsoleAgent.cpp:
     53
    1542012-07-23  Roger Fong  <roger_fong@apple.com>
    255
  • trunk/Source/WebCore/WebCore.exp.in

    r123197 r123412  
    10301030__ZN7WebCore9TimerBaseC2Ev
    10311031__ZN7WebCore9TimerBaseD2Ev
    1032 __ZN7WebCore9TreeScope12nullInstanceEv
    10331032__ZN7WebCore9closeFileERi
    10341033__ZN7WebCore9endOfWordERKNS_15VisiblePositionENS_9EWordSideE
     
    12751274__ZNK7WebCore4Node31numberOfScopedHTMLStyleChildrenEv
    12761275__ZNK7WebCore4Node9nodeIndexEv
     1276__ZNK7WebCore4Node9treeScopeEv
    12771277__ZNK7WebCore4Page10pluginDataEv
    12781278__ZNK7WebCore4Page14renderTreeSizeEv
  • trunk/Source/WebCore/dom/Document.cpp

    r123354 r123412  
    422422Document::Document(Frame* frame, const KURL& url, bool isXHTML, bool isHTML)
    423423    : ContainerNode(0, CreateDocument)
    424     , TreeScope(this, this)
     424    , TreeScope(this)
    425425    , m_guardRefCount(0)
    426426    , m_contextFeatures(ContextFeatures::defaultSwitch())
     
    496496#endif
    497497{
    498     setTreeScope(this);
     498    m_document = this;
    499499
    500500    m_pageGroupUserSheetCacheValid = false;
     
    679679        ASSERT(!m_collections[i]);
    680680
    681     setTreeScope(0);
     681    m_document = 0;
    682682
    683683    InspectorCounters::decrementCounter(InspectorCounters::DocumentCounter);
     
    13531353String Document::suggestedMIMEType() const
    13541354{
    1355     Document* doc = document();
    1356     if (doc->isXHTMLDocument())
     1355    if (m_document->isXHTMLDocument())
    13571356        return "application/xhtml+xml";
    1358     if (doc->isSVGDocument())
     1357    if (m_document->isSVGDocument())
    13591358        return "image/svg+xml";
    1360     if (doc->xmlStandalone())
     1359    if (m_document->xmlStandalone())
    13611360        return "text/xml";
    1362     if (doc->isHTMLDocument())
     1361    if (m_document->isHTMLDocument())
    13631362        return "text/html";
    13641363
  • trunk/Source/WebCore/dom/Document.h

    r123354 r123412  
    15471547// Put these methods here, because they require the Document definition, but we really want to inline them.
    15481548
    1549 inline TreeScope* Node::treeScope() const
    1550 {
    1551     return m_treeScope == TreeScope::nullInstance() ? 0 : m_treeScope;
    1552 }
    1553 
    1554 inline void Node::setTreeScope(TreeScope* scope)
    1555 {
    1556     m_treeScope = scope ? scope : TreeScope::nullInstance();
    1557     setFlag(!m_treeScope->isDocumentScope(), InShadowTree);
    1558 }
    1559 
    1560 inline Document* Node::documentInternal() const
    1561 {
    1562     if (getFlag(InShadowTree))
    1563         return m_treeScope->rootDocument();
    1564     return static_cast<Document*>(m_treeScope);
    1565 }
    1566 
    1567 inline Document* Node::document() const
    1568 {
    1569     Document* document = documentInternal();
    1570     // FIXME: below ASSERT is useful, but prevents the use of document() in the constructor or destructor
    1571     // due to the virtual function call to nodeType().
    1572     ASSERT(document || (nodeType() == DOCUMENT_TYPE_NODE && !inDocument()));
    1573     return document;
    1574 }
    1575 
    15761549inline bool Node::isDocumentNode() const
    15771550{
    1578     return this == documentInternal();
     1551    return this == m_document;
    15791552}
    15801553
    15811554inline Node::Node(Document* document, ConstructionType type)
    15821555    : m_nodeFlags(type)
    1583     , m_treeScope(0)
     1556    , m_document(document)
    15841557    , m_previous(0)
    15851558    , m_next(0)
     
    15881561    if (document)
    15891562        document->guardRef();
    1590     setTreeScope(document);
    15911563#if !defined(NDEBUG) || (defined(DUMP_NODE_STATISTICS) && DUMP_NODE_STATISTICS)
    15921564    trackForDebugging();
  • trunk/Source/WebCore/dom/Node.cpp

    r123243 r123412  
    407407        detach();
    408408
    409     Document* doc = documentInternal();
     409    Document* doc = m_document;
    410410    if (AXObjectCache::accessibilityEnabled() && doc && doc->axObjectCacheExists())
    411411        doc->axObjectCache()->removeNodeForUse(this);
     
    420420
    421421    InspectorCounters::decrementCounter(InspectorCounters::NodeCounter);
     422}
     423
     424void Node::setDocument(Document* document)
     425{
     426    ASSERT(!inDocument() || m_document == document);
     427    if (inDocument() || m_document == document)
     428        return;
     429
     430    m_document = document;
     431}
     432
     433NodeRareData* Node::setTreeScope(TreeScope* scope)
     434{
     435    if (!scope) {
     436        if (hasRareData()) {
     437            NodeRareData* data = rareData();
     438            data->setTreeScope(0);
     439            return data;
     440        }
     441
     442        return 0;
     443    }
     444
     445    NodeRareData* data = ensureRareData();
     446    data->setTreeScope(scope);
     447    return data;
     448}
     449
     450TreeScope* Node::treeScope() const
     451{
     452    // FIXME: Using m_document directly is not good -> see comment with document() in the header file.
     453    if (!hasRareData())
     454        return m_document;
     455    TreeScope* scope = rareData()->treeScope();
     456    return scope ? scope : m_document;
    422457}
    423458
     
    14391474    ContainerNode* parent = parentNode();
    14401475    return parent && !parent->isShadowRoot() ? parent : 0;
     1476}
     1477
     1478bool Node::isInShadowTree() const
     1479{
     1480    return treeScope() != document();
    14411481}
    14421482
     
    27572797    info.visitBaseClass<TreeShared<Node, ContainerNode> >(this);
    27582798    info.visitBaseClass<ScriptWrappable>(this);
    2759     info.addInstrumentedMember(document());
     2799    info.addInstrumentedMember(m_document);
    27602800    info.addInstrumentedMember(m_next);
    27612801    info.addInstrumentedMember(m_previous);
  • trunk/Source/WebCore/dom/Node.h

    r123184 r123412  
    234234    // Returns 0, a child of ShadowRoot, or a legacy shadow root.
    235235    Node* nonBoundaryShadowTreeRootNode();
    236     bool isInShadowTree() const { return getFlag(InShadowTree); }
    237 
     236    bool isInShadowTree() const;
    238237    // Node's parent, shadow tree host.
    239238    ContainerNode* parentOrHostNode() const;
     
    413412    // Returns the document associated with this node. This method never returns NULL, except in the case
    414413    // of a DocumentType node that is not used with any Document yet. A Document node returns itself.
    415     Document* document() const;
     414    Document* document() const
     415    {
     416        ASSERT(this);
     417        // FIXME: below ASSERT is useful, but prevents the use of document() in the constructor or destructor
     418        // due to the virtual function call to nodeType().
     419        ASSERT(m_document || (nodeType() == DOCUMENT_TYPE_NODE && !inDocument()));
     420        return m_document;
     421    }
    416422
    417423    TreeScope* treeScope() const;
     
    421427    bool inDocument() const
    422428    {
    423         ASSERT(treeScope() || !getFlag(InDocumentFlag));
     429        ASSERT(m_document || !getFlag(InDocumentFlag));
    424430        return getFlag(InDocumentFlag);
    425431    }
     
    691697        InNamedFlowFlag = 1 << 26,
    692698        HasAttrListFlag = 1 << 27,
    693         HasCustomCallbacksFlag = 1 << 28,
    694         InShadowTree = 1 << 29
    695 
     699        HasCustomCallbacksFlag = 1 << 28
    696700    };
    697701
    698     // 3 bits remaining
     702    // 4 bits remaining
    699703
    700704    bool getFlag(NodeFlags mask) const { return m_nodeFlags & mask; }
     
    732736    void setHasCustomCallbacks() { setFlag(true, HasCustomCallbacksFlag); }
    733737
    734     void setTreeScope(TreeScope*);
    735     Document* documentInternal() const;
    736 
    737738private:
    738739    friend class TreeShared<Node, ContainerNode>;
    739740
    740741    void removedLastRef();
     742
     743    // These API should be only used for a tree scope migration.
     744    // setTreeScope() returns NodeRareData to save extra nodeRareData() invocations on the caller site.
     745    NodeRareData* setTreeScope(TreeScope*);
     746    void setDocument(Document*);
    741747
    742748    enum EditableLevel { Editable, RichlyEditable };
     
    782788
    783789    mutable uint32_t m_nodeFlags;
    784     TreeScope* m_treeScope;
     790    Document* m_document;
    785791    Node* m_previous;
    786792    Node* m_next;
  • trunk/Source/WebCore/dom/NodeRareData.h

    r123184 r123412  
    185185public:   
    186186    NodeRareData()
    187         : m_childNodeList(0)
     187        : m_treeScope(0)
     188        , m_childNodeList(0)
    188189        , m_tabIndex(0)
    189190        , m_tabIndexWasSetExplicitly(false)
     
    213214    }
    214215
     216    TreeScope* treeScope() const { return m_treeScope; }
     217    void setTreeScope(TreeScope* treeScope) { m_treeScope = treeScope; }
     218   
    215219    void clearNodeLists() { m_nodeLists.clear(); }
    216220    void setNodeLists(PassOwnPtr<NodeListsNodeData> lists) { m_nodeLists = lists; }
     
    346350private:
    347351
     352    TreeScope* m_treeScope;
    348353    OwnPtr<NodeListsNodeData> m_nodeLists;
    349354    ChildNodeList* m_childNodeList;
  • trunk/Source/WebCore/dom/ShadowRoot.cpp

    r123184 r123412  
    4747ShadowRoot::ShadowRoot(Document* document)
    4848    : DocumentFragment(document, CreateShadowRoot)
    49     , TreeScope(this, document)
     49    , TreeScope(this)
    5050    , m_prev(0)
    5151    , m_next(0)
     
    5656    ASSERT(document);
    5757   
     58    // Assume document as parent scope.
     59    setParentTreeScope(document);
    5860    // Shadow tree scopes have the scope pointer point to themselves.
    5961    // This way, direct children will receive the correct scope pointer.
    60     setTreeScope(this);
     62    ensureRareData()->setTreeScope(this);
    6163}
    6264
  • trunk/Source/WebCore/dom/TreeScope.cpp

    r123329 r123412  
    5353using namespace HTMLNames;
    5454
    55 TreeScope::TreeScope(ContainerNode* rootNode, Document* rootDocument)
     55TreeScope::TreeScope(ContainerNode* rootNode)
    5656    : m_rootNode(rootNode)
    57     , m_rootDocument(rootDocument)
    58     , m_parentTreeScope(rootNode == rootDocument ? 0 : rootDocument)
     57    , m_parentTreeScope(0)
    5958    , m_idTargetObserverRegistry(IdTargetObserverRegistry::create())
    6059{
    6160    ASSERT(rootNode);
    62 }
    63 
    64 TreeScope::TreeScope()
    65     : m_rootNode(0)
    66     , m_rootDocument(0)
    67     , m_parentTreeScope(0)
    68 {
    6961}
    7062
     
    9183
    9284    m_parentTreeScope = newParentScope;
    93     m_rootDocument = newParentScope->rootDocument();
    9485}
    9586
     
    258249}
    259250
    260 bool TreeScope::isDocumentScope() const
    261 {
    262     return this == m_rootDocument;
    263 }
    264 
    265251static void listTreeScopes(Node* node, Vector<TreeScope*, 5>& treeScopes)
    266252{
     
    296282}
    297283
    298 TreeScope* TreeScope::nullInstance()
    299 {
    300     DEFINE_STATIC_LOCAL(TreeScope, instance, ());
    301     return &instance;
    302 }
    303 
    304284} // namespace WebCore
    305285
  • trunk/Source/WebCore/dom/TreeScope.h

    r123184 r123412  
    3535class ContainerNode;
    3636class DOMSelection;
    37 class Document;
    3837class Element;
    3938class HTMLMapElement;
     
    8079
    8180    ContainerNode* rootNode() const { return m_rootNode; }
    82     Document* rootDocument() const { return m_rootDocument; }
    83     bool isDocumentScope() const;
     81
    8482    IdTargetObserverRegistry& idTargetObserverRegistry() const { return *m_idTargetObserverRegistry.get(); }
    8583
    86     static TreeScope* nullInstance();
    87 
    8884protected:
    89     TreeScope(ContainerNode*, Document*);
     85    TreeScope(ContainerNode*);
    9086    virtual ~TreeScope();
    9187
     
    9389
    9490private:
    95     TreeScope();
    96 
    9791    ContainerNode* m_rootNode;
    98     Document* m_rootDocument;
    9992    TreeScope* m_parentTreeScope;
    10093
  • trunk/Source/WebCore/dom/TreeScopeAdopter.cpp

    r123184 r123412  
    5050
    5151    for (Node* node = root; node; node = node->traverseNextNode(root)) {
    52         node->setTreeScope(m_newScope);
    53         if (node->hasRareData()) {
    54             NodeRareData* rareData = node->rareData();
     52        if (NodeRareData* rareData = node->setTreeScope(newDocument == m_newScope ? 0 : m_newScope)) {
    5553            if (rareData->nodeLists())
    5654                rareData->nodeLists()->adoptTreeScope(oldDocument, newDocument);
     
    9997        oldDocument->moveNodeIteratorsToNewDocument(node, newDocument);
    10098
     99    node->setDocument(newDocument);
     100
    101101#ifndef NDEBUG
    102102    didMoveToNewDocumentWasCalled = false;
  • trunk/Source/WebCore/editing/MoveSelectionCommand.cpp

    r123184 r123412  
    2727#include "MoveSelectionCommand.h"
    2828
    29 #include "Document.h"
    3029#include "DocumentFragment.h"
    3130#include "ReplaceSelectionCommand.h"
  • trunk/Source/WebCore/editing/RemoveNodeCommand.cpp

    r123184 r123412  
    2727#include "RemoveNodeCommand.h"
    2828
    29 #include "Document.h"
    3029#include "Node.h"
    3130#include <wtf/Assertions.h>
  • trunk/Source/WebCore/editing/RemoveNodePreservingChildrenCommand.cpp

    r123184 r123412  
    2727#include "RemoveNodePreservingChildrenCommand.h"
    2828
    29 #include "Document.h"
    3029#include "Node.h"
    3130#include <wtf/Assertions.h>
  • trunk/Source/WebCore/inspector/PageConsoleAgent.cpp

    r123184 r123412  
    3636
    3737#include "DOMWindow.h"
    38 #include "Document.h"
    3938#include "InjectedScriptHost.h"
    4039#include "InjectedScriptManager.h"
  • trunk/Source/WebKit2/ChangeLog

    r123379 r123412  
     12012-07-23  Sheriff Bot  <webkit.review.bot@gmail.com>
     2
     3        Unreviewed, rolling out r123184, r123195, and r123197.
     4        http://trac.webkit.org/changeset/123184
     5        http://trac.webkit.org/changeset/123195
     6        http://trac.webkit.org/changeset/123197
     7        https://bugs.webkit.org/show_bug.cgi?id=92049
     8
     9        pagecycler regression (Requested by morrita on #webkit).
     10
     11        * win/WebKit2.def:
     12        * win/WebKit2CFLite.def:
     13
    1142012-07-23  Simon Fraser  <simon.fraser@apple.com>
    215
  • trunk/Source/WebKit2/win/WebKit2.def

    r123184 r123412  
    254254        ?contextDestroyed@ContextDestructionObserver@WebCore@@UAEXXZ
    255255        ??0ContextDestructionObserver@WebCore@@QAE@PAVScriptExecutionContext@1@@Z
    256         ?nullInstance@TreeScope@WebCore@@SAPAV12@XZ
    257256        ?nodesFromRect@Document@WebCore@@QBE?AV?$PassRefPtr@VNodeList@WebCore@@@WTF@@HHIIII_N0@Z
    258257        ?selectionStartHasMarkerFor@Editor@WebCore@@QBE_NW4MarkerType@DocumentMarker@2@HH@Z
  • trunk/Source/WebKit2/win/WebKit2CFLite.def

    r123184 r123412  
    247247        ?utf8@String@WTF@@QBE?AVCString@2@_N@Z
    248248        ?view@Document@WebCore@@QBEPAVFrameView@2@XZ
    249         ?nullInstance@TreeScope@WebCore@@SAPAV12@XZ
    250249        ?nodesFromRect@Document@WebCore@@QBE?AV?$PassRefPtr@VNodeList@WebCore@@@WTF@@HHIIII_N0@Z
    251250        ?selectionStartHasMarkerFor@Editor@WebCore@@QBE_NW4MarkerType@DocumentMarker@2@HH@Z
  • trunk/Source/autotools/symbols.filter

    r123184 r123412  
    168168_ZN7WebCore26ContextDestructionObserverC2EPNS_22ScriptExecutionContextE;
    169169_ZN7WebCore26ContextDestructionObserver16contextDestroyedEv;
    170 _ZN7WebCore9TreeScope12nullInstanceEv;
    171170local:
    172171_Z*;
Note: See TracChangeset for help on using the changeset viewer.