Changeset 123412 in webkit
- Timestamp:
- Jul 23, 2012 5:53:24 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r123411 r123412 1 2012-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 1 13 2012-07-23 Roger Fong <roger_fong@apple.com> 2 14 -
trunk/Source/WebCore/ChangeLog
r123411 r123412 1 2012-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 1 54 2012-07-23 Roger Fong <roger_fong@apple.com> 2 55 -
trunk/Source/WebCore/WebCore.exp.in
r123197 r123412 1030 1030 __ZN7WebCore9TimerBaseC2Ev 1031 1031 __ZN7WebCore9TimerBaseD2Ev 1032 __ZN7WebCore9TreeScope12nullInstanceEv1033 1032 __ZN7WebCore9closeFileERi 1034 1033 __ZN7WebCore9endOfWordERKNS_15VisiblePositionENS_9EWordSideE … … 1275 1274 __ZNK7WebCore4Node31numberOfScopedHTMLStyleChildrenEv 1276 1275 __ZNK7WebCore4Node9nodeIndexEv 1276 __ZNK7WebCore4Node9treeScopeEv 1277 1277 __ZNK7WebCore4Page10pluginDataEv 1278 1278 __ZNK7WebCore4Page14renderTreeSizeEv -
trunk/Source/WebCore/dom/Document.cpp
r123354 r123412 422 422 Document::Document(Frame* frame, const KURL& url, bool isXHTML, bool isHTML) 423 423 : ContainerNode(0, CreateDocument) 424 , TreeScope(this , this)424 , TreeScope(this) 425 425 , m_guardRefCount(0) 426 426 , m_contextFeatures(ContextFeatures::defaultSwitch()) … … 496 496 #endif 497 497 { 498 setTreeScope(this);498 m_document = this; 499 499 500 500 m_pageGroupUserSheetCacheValid = false; … … 679 679 ASSERT(!m_collections[i]); 680 680 681 setTreeScope(0);681 m_document = 0; 682 682 683 683 InspectorCounters::decrementCounter(InspectorCounters::DocumentCounter); … … 1353 1353 String Document::suggestedMIMEType() const 1354 1354 { 1355 Document* doc = document(); 1356 if (doc->isXHTMLDocument()) 1355 if (m_document->isXHTMLDocument()) 1357 1356 return "application/xhtml+xml"; 1358 if ( doc->isSVGDocument())1357 if (m_document->isSVGDocument()) 1359 1358 return "image/svg+xml"; 1360 if ( doc->xmlStandalone())1359 if (m_document->xmlStandalone()) 1361 1360 return "text/xml"; 1362 if ( doc->isHTMLDocument())1361 if (m_document->isHTMLDocument()) 1363 1362 return "text/html"; 1364 1363 -
trunk/Source/WebCore/dom/Document.h
r123354 r123412 1547 1547 // Put these methods here, because they require the Document definition, but we really want to inline them. 1548 1548 1549 inline TreeScope* Node::treeScope() const1550 {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() const1561 {1562 if (getFlag(InShadowTree))1563 return m_treeScope->rootDocument();1564 return static_cast<Document*>(m_treeScope);1565 }1566 1567 inline Document* Node::document() const1568 {1569 Document* document = documentInternal();1570 // FIXME: below ASSERT is useful, but prevents the use of document() in the constructor or destructor1571 // due to the virtual function call to nodeType().1572 ASSERT(document || (nodeType() == DOCUMENT_TYPE_NODE && !inDocument()));1573 return document;1574 }1575 1576 1549 inline bool Node::isDocumentNode() const 1577 1550 { 1578 return this == documentInternal();1551 return this == m_document; 1579 1552 } 1580 1553 1581 1554 inline Node::Node(Document* document, ConstructionType type) 1582 1555 : m_nodeFlags(type) 1583 , m_ treeScope(0)1556 , m_document(document) 1584 1557 , m_previous(0) 1585 1558 , m_next(0) … … 1588 1561 if (document) 1589 1562 document->guardRef(); 1590 setTreeScope(document);1591 1563 #if !defined(NDEBUG) || (defined(DUMP_NODE_STATISTICS) && DUMP_NODE_STATISTICS) 1592 1564 trackForDebugging(); -
trunk/Source/WebCore/dom/Node.cpp
r123243 r123412 407 407 detach(); 408 408 409 Document* doc = documentInternal();409 Document* doc = m_document; 410 410 if (AXObjectCache::accessibilityEnabled() && doc && doc->axObjectCacheExists()) 411 411 doc->axObjectCache()->removeNodeForUse(this); … … 420 420 421 421 InspectorCounters::decrementCounter(InspectorCounters::NodeCounter); 422 } 423 424 void 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 433 NodeRareData* 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 450 TreeScope* 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; 422 457 } 423 458 … … 1439 1474 ContainerNode* parent = parentNode(); 1440 1475 return parent && !parent->isShadowRoot() ? parent : 0; 1476 } 1477 1478 bool Node::isInShadowTree() const 1479 { 1480 return treeScope() != document(); 1441 1481 } 1442 1482 … … 2757 2797 info.visitBaseClass<TreeShared<Node, ContainerNode> >(this); 2758 2798 info.visitBaseClass<ScriptWrappable>(this); 2759 info.addInstrumentedMember( document());2799 info.addInstrumentedMember(m_document); 2760 2800 info.addInstrumentedMember(m_next); 2761 2801 info.addInstrumentedMember(m_previous); -
trunk/Source/WebCore/dom/Node.h
r123184 r123412 234 234 // Returns 0, a child of ShadowRoot, or a legacy shadow root. 235 235 Node* nonBoundaryShadowTreeRootNode(); 236 bool isInShadowTree() const { return getFlag(InShadowTree); } 237 236 bool isInShadowTree() const; 238 237 // Node's parent, shadow tree host. 239 238 ContainerNode* parentOrHostNode() const; … … 413 412 // Returns the document associated with this node. This method never returns NULL, except in the case 414 413 // 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 } 416 422 417 423 TreeScope* treeScope() const; … … 421 427 bool inDocument() const 422 428 { 423 ASSERT( treeScope()|| !getFlag(InDocumentFlag));429 ASSERT(m_document || !getFlag(InDocumentFlag)); 424 430 return getFlag(InDocumentFlag); 425 431 } … … 691 697 InNamedFlowFlag = 1 << 26, 692 698 HasAttrListFlag = 1 << 27, 693 HasCustomCallbacksFlag = 1 << 28, 694 InShadowTree = 1 << 29 695 699 HasCustomCallbacksFlag = 1 << 28 696 700 }; 697 701 698 // 3bits remaining702 // 4 bits remaining 699 703 700 704 bool getFlag(NodeFlags mask) const { return m_nodeFlags & mask; } … … 732 736 void setHasCustomCallbacks() { setFlag(true, HasCustomCallbacksFlag); } 733 737 734 void setTreeScope(TreeScope*);735 Document* documentInternal() const;736 737 738 private: 738 739 friend class TreeShared<Node, ContainerNode>; 739 740 740 741 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*); 741 747 742 748 enum EditableLevel { Editable, RichlyEditable }; … … 782 788 783 789 mutable uint32_t m_nodeFlags; 784 TreeScope* m_treeScope;790 Document* m_document; 785 791 Node* m_previous; 786 792 Node* m_next; -
trunk/Source/WebCore/dom/NodeRareData.h
r123184 r123412 185 185 public: 186 186 NodeRareData() 187 : m_childNodeList(0) 187 : m_treeScope(0) 188 , m_childNodeList(0) 188 189 , m_tabIndex(0) 189 190 , m_tabIndexWasSetExplicitly(false) … … 213 214 } 214 215 216 TreeScope* treeScope() const { return m_treeScope; } 217 void setTreeScope(TreeScope* treeScope) { m_treeScope = treeScope; } 218 215 219 void clearNodeLists() { m_nodeLists.clear(); } 216 220 void setNodeLists(PassOwnPtr<NodeListsNodeData> lists) { m_nodeLists = lists; } … … 346 350 private: 347 351 352 TreeScope* m_treeScope; 348 353 OwnPtr<NodeListsNodeData> m_nodeLists; 349 354 ChildNodeList* m_childNodeList; -
trunk/Source/WebCore/dom/ShadowRoot.cpp
r123184 r123412 47 47 ShadowRoot::ShadowRoot(Document* document) 48 48 : DocumentFragment(document, CreateShadowRoot) 49 , TreeScope(this , document)49 , TreeScope(this) 50 50 , m_prev(0) 51 51 , m_next(0) … … 56 56 ASSERT(document); 57 57 58 // Assume document as parent scope. 59 setParentTreeScope(document); 58 60 // Shadow tree scopes have the scope pointer point to themselves. 59 61 // This way, direct children will receive the correct scope pointer. 60 setTreeScope(this);62 ensureRareData()->setTreeScope(this); 61 63 } 62 64 -
trunk/Source/WebCore/dom/TreeScope.cpp
r123329 r123412 53 53 using namespace HTMLNames; 54 54 55 TreeScope::TreeScope(ContainerNode* rootNode , Document* rootDocument)55 TreeScope::TreeScope(ContainerNode* rootNode) 56 56 : m_rootNode(rootNode) 57 , m_rootDocument(rootDocument) 58 , m_parentTreeScope(rootNode == rootDocument ? 0 : rootDocument) 57 , m_parentTreeScope(0) 59 58 , m_idTargetObserverRegistry(IdTargetObserverRegistry::create()) 60 59 { 61 60 ASSERT(rootNode); 62 }63 64 TreeScope::TreeScope()65 : m_rootNode(0)66 , m_rootDocument(0)67 , m_parentTreeScope(0)68 {69 61 } 70 62 … … 91 83 92 84 m_parentTreeScope = newParentScope; 93 m_rootDocument = newParentScope->rootDocument();94 85 } 95 86 … … 258 249 } 259 250 260 bool TreeScope::isDocumentScope() const261 {262 return this == m_rootDocument;263 }264 265 251 static void listTreeScopes(Node* node, Vector<TreeScope*, 5>& treeScopes) 266 252 { … … 296 282 } 297 283 298 TreeScope* TreeScope::nullInstance()299 {300 DEFINE_STATIC_LOCAL(TreeScope, instance, ());301 return &instance;302 }303 304 284 } // namespace WebCore 305 285 -
trunk/Source/WebCore/dom/TreeScope.h
r123184 r123412 35 35 class ContainerNode; 36 36 class DOMSelection; 37 class Document;38 37 class Element; 39 38 class HTMLMapElement; … … 80 79 81 80 ContainerNode* rootNode() const { return m_rootNode; } 82 Document* rootDocument() const { return m_rootDocument; } 83 bool isDocumentScope() const; 81 84 82 IdTargetObserverRegistry& idTargetObserverRegistry() const { return *m_idTargetObserverRegistry.get(); } 85 83 86 static TreeScope* nullInstance();87 88 84 protected: 89 TreeScope(ContainerNode* , Document*);85 TreeScope(ContainerNode*); 90 86 virtual ~TreeScope(); 91 87 … … 93 89 94 90 private: 95 TreeScope();96 97 91 ContainerNode* m_rootNode; 98 Document* m_rootDocument;99 92 TreeScope* m_parentTreeScope; 100 93 -
trunk/Source/WebCore/dom/TreeScopeAdopter.cpp
r123184 r123412 50 50 51 51 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)) { 55 53 if (rareData->nodeLists()) 56 54 rareData->nodeLists()->adoptTreeScope(oldDocument, newDocument); … … 99 97 oldDocument->moveNodeIteratorsToNewDocument(node, newDocument); 100 98 99 node->setDocument(newDocument); 100 101 101 #ifndef NDEBUG 102 102 didMoveToNewDocumentWasCalled = false; -
trunk/Source/WebCore/editing/MoveSelectionCommand.cpp
r123184 r123412 27 27 #include "MoveSelectionCommand.h" 28 28 29 #include "Document.h"30 29 #include "DocumentFragment.h" 31 30 #include "ReplaceSelectionCommand.h" -
trunk/Source/WebCore/editing/RemoveNodeCommand.cpp
r123184 r123412 27 27 #include "RemoveNodeCommand.h" 28 28 29 #include "Document.h"30 29 #include "Node.h" 31 30 #include <wtf/Assertions.h> -
trunk/Source/WebCore/editing/RemoveNodePreservingChildrenCommand.cpp
r123184 r123412 27 27 #include "RemoveNodePreservingChildrenCommand.h" 28 28 29 #include "Document.h"30 29 #include "Node.h" 31 30 #include <wtf/Assertions.h> -
trunk/Source/WebCore/inspector/PageConsoleAgent.cpp
r123184 r123412 36 36 37 37 #include "DOMWindow.h" 38 #include "Document.h"39 38 #include "InjectedScriptHost.h" 40 39 #include "InjectedScriptManager.h" -
trunk/Source/WebKit2/ChangeLog
r123379 r123412 1 2012-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 1 14 2012-07-23 Simon Fraser <simon.fraser@apple.com> 2 15 -
trunk/Source/WebKit2/win/WebKit2.def
r123184 r123412 254 254 ?contextDestroyed@ContextDestructionObserver@WebCore@@UAEXXZ 255 255 ??0ContextDestructionObserver@WebCore@@QAE@PAVScriptExecutionContext@1@@Z 256 ?nullInstance@TreeScope@WebCore@@SAPAV12@XZ257 256 ?nodesFromRect@Document@WebCore@@QBE?AV?$PassRefPtr@VNodeList@WebCore@@@WTF@@HHIIII_N0@Z 258 257 ?selectionStartHasMarkerFor@Editor@WebCore@@QBE_NW4MarkerType@DocumentMarker@2@HH@Z -
trunk/Source/WebKit2/win/WebKit2CFLite.def
r123184 r123412 247 247 ?utf8@String@WTF@@QBE?AVCString@2@_N@Z 248 248 ?view@Document@WebCore@@QBEPAVFrameView@2@XZ 249 ?nullInstance@TreeScope@WebCore@@SAPAV12@XZ250 249 ?nodesFromRect@Document@WebCore@@QBE?AV?$PassRefPtr@VNodeList@WebCore@@@WTF@@HHIIII_N0@Z 251 250 ?selectionStartHasMarkerFor@Editor@WebCore@@QBE_NW4MarkerType@DocumentMarker@2@HH@Z -
trunk/Source/autotools/symbols.filter
r123184 r123412 168 168 _ZN7WebCore26ContextDestructionObserverC2EPNS_22ScriptExecutionContextE; 169 169 _ZN7WebCore26ContextDestructionObserver16contextDestroyedEv; 170 _ZN7WebCore9TreeScope12nullInstanceEv;171 170 local: 172 171 _Z*;
Note: See TracChangeset
for help on using the changeset viewer.