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:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123412
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-07-23 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ 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).
+
+ * Source/autotools/symbols.filter:
+
2012-07-23 Roger Fong <roger_fong@apple.com>
If select element in Windows is off screen horizontally,
+2012-07-23 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ 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).
+
+ * 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:
+
2012-07-23 Roger Fong <roger_fong@apple.com>
On Windows, if select element is off screen horizontally,
__ZN7WebCore9TimerBase5startEdd
__ZN7WebCore9TimerBaseC2Ev
__ZN7WebCore9TimerBaseD2Ev
-__ZN7WebCore9TreeScope12nullInstanceEv
__ZN7WebCore9closeFileERi
__ZN7WebCore9endOfWordERKNS_15VisiblePositionENS_9EWordSideE
__ZN7WebCore9fontCacheEv
__ZNK7WebCore4Node27traverseNextAncestorSiblingEv
__ZNK7WebCore4Node31numberOfScopedHTMLStyleChildrenEv
__ZNK7WebCore4Node9nodeIndexEv
+__ZNK7WebCore4Node9treeScopeEv
__ZNK7WebCore4Page10pluginDataEv
__ZNK7WebCore4Page14renderTreeSizeEv
__ZNK7WebCore4Page15backForwardListEv
Document::Document(Frame* frame, const KURL& url, bool isXHTML, bool isHTML)
: ContainerNode(0, CreateDocument)
- , TreeScope(this, this)
+ , TreeScope(this)
, m_guardRefCount(0)
, m_contextFeatures(ContextFeatures::defaultSwitch())
, m_compatibilityMode(NoQuirksMode)
, m_didDispatchViewportPropertiesChanged(false)
#endif
{
- setTreeScope(this);
+ m_document = this;
m_pageGroupUserSheetCacheValid = false;
for (unsigned i = 0; i < WTF_ARRAY_LENGTH(m_collections); i++)
ASSERT(!m_collections[i]);
- setTreeScope(0);
+ m_document = 0;
InspectorCounters::decrementCounter(InspectorCounters::DocumentCounter);
}
String Document::suggestedMIMEType() const
{
- Document* doc = document();
- if (doc->isXHTMLDocument())
+ if (m_document->isXHTMLDocument())
return "application/xhtml+xml";
- if (doc->isSVGDocument())
+ if (m_document->isSVGDocument())
return "image/svg+xml";
- if (doc->xmlStandalone())
+ if (m_document->xmlStandalone())
return "text/xml";
- if (doc->isHTMLDocument())
+ if (m_document->isHTMLDocument())
return "text/html";
if (DocumentLoader* documentLoader = loader())
// Put these methods here, because they require the Document definition, but we really want to inline them.
-inline TreeScope* Node::treeScope() const
-{
- return m_treeScope == TreeScope::nullInstance() ? 0 : m_treeScope;
-}
-
-inline void Node::setTreeScope(TreeScope* scope)
-{
- m_treeScope = scope ? scope : TreeScope::nullInstance();
- setFlag(!m_treeScope->isDocumentScope(), InShadowTree);
-}
-
-inline Document* Node::documentInternal() const
-{
- if (getFlag(InShadowTree))
- return m_treeScope->rootDocument();
- return static_cast<Document*>(m_treeScope);
-}
-
-inline Document* Node::document() const
-{
- Document* document = documentInternal();
- // FIXME: below ASSERT is useful, but prevents the use of document() in the constructor or destructor
- // due to the virtual function call to nodeType().
- ASSERT(document || (nodeType() == DOCUMENT_TYPE_NODE && !inDocument()));
- return document;
-}
-
inline bool Node::isDocumentNode() const
{
- return this == documentInternal();
+ return this == m_document;
}
inline Node::Node(Document* document, ConstructionType type)
: m_nodeFlags(type)
- , m_treeScope(0)
+ , m_document(document)
, m_previous(0)
, m_next(0)
, m_renderer(0)
{
if (document)
document->guardRef();
- setTreeScope(document);
#if !defined(NDEBUG) || (defined(DUMP_NODE_STATISTICS) && DUMP_NODE_STATISTICS)
trackForDebugging();
#endif
if (renderer())
detach();
- Document* doc = documentInternal();
+ Document* doc = m_document;
if (AXObjectCache::accessibilityEnabled() && doc && doc->axObjectCacheExists())
doc->axObjectCache()->removeNodeForUse(this);
InspectorCounters::decrementCounter(InspectorCounters::NodeCounter);
}
+void Node::setDocument(Document* document)
+{
+ ASSERT(!inDocument() || m_document == document);
+ if (inDocument() || m_document == document)
+ return;
+
+ m_document = document;
+}
+
+NodeRareData* Node::setTreeScope(TreeScope* scope)
+{
+ if (!scope) {
+ if (hasRareData()) {
+ NodeRareData* data = rareData();
+ data->setTreeScope(0);
+ return data;
+ }
+
+ return 0;
+ }
+
+ NodeRareData* data = ensureRareData();
+ data->setTreeScope(scope);
+ return data;
+}
+
+TreeScope* Node::treeScope() const
+{
+ // FIXME: Using m_document directly is not good -> see comment with document() in the header file.
+ if (!hasRareData())
+ return m_document;
+ TreeScope* scope = rareData()->treeScope();
+ return scope ? scope : m_document;
+}
+
NodeRareData* Node::rareData() const
{
ASSERT(hasRareData());
return parent && !parent->isShadowRoot() ? parent : 0;
}
+bool Node::isInShadowTree() const
+{
+ return treeScope() != document();
+}
+
Element* Node::parentOrHostElement() const
{
ContainerNode* parent = parentOrHostNode();
MemoryClassInfo<Node> info(memoryObjectInfo, this, MemoryInstrumentation::DOM);
info.visitBaseClass<TreeShared<Node, ContainerNode> >(this);
info.visitBaseClass<ScriptWrappable>(this);
- info.addInstrumentedMember(document());
+ info.addInstrumentedMember(m_document);
info.addInstrumentedMember(m_next);
info.addInstrumentedMember(m_previous);
}
// Returns 0, a child of ShadowRoot, or a legacy shadow root.
Node* nonBoundaryShadowTreeRootNode();
- bool isInShadowTree() const { return getFlag(InShadowTree); }
-
+ bool isInShadowTree() const;
// Node's parent, shadow tree host.
ContainerNode* parentOrHostNode() const;
Element* parentOrHostElement() const;
// Returns the document associated with this node. This method never returns NULL, except in the case
// of a DocumentType node that is not used with any Document yet. A Document node returns itself.
- Document* document() const;
+ Document* document() const
+ {
+ ASSERT(this);
+ // FIXME: below ASSERT is useful, but prevents the use of document() in the constructor or destructor
+ // due to the virtual function call to nodeType().
+ ASSERT(m_document || (nodeType() == DOCUMENT_TYPE_NODE && !inDocument()));
+ return m_document;
+ }
TreeScope* treeScope() const;
// node tree, false otherwise.
bool inDocument() const
{
- ASSERT(treeScope() || !getFlag(InDocumentFlag));
+ ASSERT(m_document || !getFlag(InDocumentFlag));
return getFlag(InDocumentFlag);
}
#endif
InNamedFlowFlag = 1 << 26,
HasAttrListFlag = 1 << 27,
- HasCustomCallbacksFlag = 1 << 28,
- InShadowTree = 1 << 29
-
+ HasCustomCallbacksFlag = 1 << 28
};
- // 3 bits remaining
+ // 4 bits remaining
bool getFlag(NodeFlags mask) const { return m_nodeFlags & mask; }
void setFlag(bool f, NodeFlags mask) const { m_nodeFlags = (m_nodeFlags & ~mask) | (-(int32_t)f & mask); }
void setHasCustomCallbacks() { setFlag(true, HasCustomCallbacksFlag); }
- void setTreeScope(TreeScope*);
- Document* documentInternal() const;
-
private:
friend class TreeShared<Node, ContainerNode>;
void removedLastRef();
+ // These API should be only used for a tree scope migration.
+ // setTreeScope() returns NodeRareData to save extra nodeRareData() invocations on the caller site.
+ NodeRareData* setTreeScope(TreeScope*);
+ void setDocument(Document*);
+
enum EditableLevel { Editable, RichlyEditable };
bool rendererIsEditable(EditableLevel) const;
bool isEditableToAccessibility(EditableLevel) const;
#endif
mutable uint32_t m_nodeFlags;
- TreeScope* m_treeScope;
+ Document* m_document;
Node* m_previous;
Node* m_next;
RenderObject* m_renderer;
WTF_MAKE_NONCOPYABLE(NodeRareData); WTF_MAKE_FAST_ALLOCATED;
public:
NodeRareData()
- : m_childNodeList(0)
+ : m_treeScope(0)
+ , m_childNodeList(0)
, m_tabIndex(0)
, m_tabIndexWasSetExplicitly(false)
, m_isFocused(false)
return rareDataMap().get(node);
}
+ TreeScope* treeScope() const { return m_treeScope; }
+ void setTreeScope(TreeScope* treeScope) { m_treeScope = treeScope; }
+
void clearNodeLists() { m_nodeLists.clear(); }
void setNodeLists(PassOwnPtr<NodeListsNodeData> lists) { m_nodeLists = lists; }
NodeListsNodeData* nodeLists() const { return m_nodeLists.get(); }
private:
+ TreeScope* m_treeScope;
OwnPtr<NodeListsNodeData> m_nodeLists;
ChildNodeList* m_childNodeList;
OwnPtr<EventTargetData> m_eventTargetData;
ShadowRoot::ShadowRoot(Document* document)
: DocumentFragment(document, CreateShadowRoot)
- , TreeScope(this, document)
+ , TreeScope(this)
, m_prev(0)
, m_next(0)
, m_applyAuthorStyles(false)
{
ASSERT(document);
+ // Assume document as parent scope.
+ setParentTreeScope(document);
// Shadow tree scopes have the scope pointer point to themselves.
// This way, direct children will receive the correct scope pointer.
- setTreeScope(this);
+ ensureRareData()->setTreeScope(this);
}
ShadowRoot::~ShadowRoot()
using namespace HTMLNames;
-TreeScope::TreeScope(ContainerNode* rootNode, Document* rootDocument)
+TreeScope::TreeScope(ContainerNode* rootNode)
: m_rootNode(rootNode)
- , m_rootDocument(rootDocument)
- , m_parentTreeScope(rootNode == rootDocument ? 0 : rootDocument)
+ , m_parentTreeScope(0)
, m_idTargetObserverRegistry(IdTargetObserverRegistry::create())
{
ASSERT(rootNode);
}
-TreeScope::TreeScope()
- : m_rootNode(0)
- , m_rootDocument(0)
- , m_parentTreeScope(0)
-{
-}
-
TreeScope::~TreeScope()
{
if (m_selection) {
ASSERT(newParentScope);
m_parentTreeScope = newParentScope;
- m_rootDocument = newParentScope->rootDocument();
}
Element* TreeScope::getElementById(const AtomicString& elementId) const
return 0;
}
-bool TreeScope::isDocumentScope() const
-{
- return this == m_rootDocument;
-}
-
static void listTreeScopes(Node* node, Vector<TreeScope*, 5>& treeScopes)
{
while (true) {
return treeScopesA[indexA] == treeScopesB[indexB] ? treeScopesA[indexA] : 0;
}
-TreeScope* TreeScope::nullInstance()
-{
- DEFINE_STATIC_LOCAL(TreeScope, instance, ());
- return &instance;
-}
-
} // namespace WebCore
class ContainerNode;
class DOMSelection;
-class Document;
class Element;
class HTMLMapElement;
class IdTargetObserverRegistry;
void adoptIfNeeded(Node*);
ContainerNode* rootNode() const { return m_rootNode; }
- Document* rootDocument() const { return m_rootDocument; }
- bool isDocumentScope() const;
- IdTargetObserverRegistry& idTargetObserverRegistry() const { return *m_idTargetObserverRegistry.get(); }
- static TreeScope* nullInstance();
+ IdTargetObserverRegistry& idTargetObserverRegistry() const { return *m_idTargetObserverRegistry.get(); }
protected:
- TreeScope(ContainerNode*, Document*);
+ TreeScope(ContainerNode*);
virtual ~TreeScope();
void destroyTreeScopeData();
private:
- TreeScope();
-
ContainerNode* m_rootNode;
- Document* m_rootDocument;
TreeScope* m_parentTreeScope;
DocumentOrderedMap m_elementsById;
oldDocument->incDOMTreeVersion();
for (Node* node = root; node; node = node->traverseNextNode(root)) {
- node->setTreeScope(m_newScope);
- if (node->hasRareData()) {
- NodeRareData* rareData = node->rareData();
+ if (NodeRareData* rareData = node->setTreeScope(newDocument == m_newScope ? 0 : m_newScope)) {
if (rareData->nodeLists())
rareData->nodeLists()->adoptTreeScope(oldDocument, newDocument);
if (node->isElementNode())
if (oldDocument)
oldDocument->moveNodeIteratorsToNewDocument(node, newDocument);
+ node->setDocument(newDocument);
+
#ifndef NDEBUG
didMoveToNewDocumentWasCalled = false;
oldDocumentDidMoveToNewDocumentWasCalledWith = oldDocument;
#include "config.h"
#include "MoveSelectionCommand.h"
-#include "Document.h"
#include "DocumentFragment.h"
#include "ReplaceSelectionCommand.h"
#include "config.h"
#include "RemoveNodeCommand.h"
-#include "Document.h"
#include "Node.h"
#include <wtf/Assertions.h>
#include "config.h"
#include "RemoveNodePreservingChildrenCommand.h"
-#include "Document.h"
#include "Node.h"
#include <wtf/Assertions.h>
#include "PageConsoleAgent.h"
#include "DOMWindow.h"
-#include "Document.h"
#include "InjectedScriptHost.h"
#include "InjectedScriptManager.h"
#include "InspectorAgent.h"
+2012-07-23 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ 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).
+
+ * win/WebKit2.def:
+ * win/WebKit2CFLite.def:
+
2012-07-23 Simon Fraser <simon.fraser@apple.com>
Part 2 of: Implement sticky positioning
??1ContextDestructionObserver@WebCore@@MAE@XZ
?contextDestroyed@ContextDestructionObserver@WebCore@@UAEXXZ
??0ContextDestructionObserver@WebCore@@QAE@PAVScriptExecutionContext@1@@Z
- ?nullInstance@TreeScope@WebCore@@SAPAV12@XZ
?nodesFromRect@Document@WebCore@@QBE?AV?$PassRefPtr@VNodeList@WebCore@@@WTF@@HHIIII_N0@Z
?selectionStartHasMarkerFor@Editor@WebCore@@QBE_NW4MarkerType@DocumentMarker@2@HH@Z
?webkitWillEnterFullScreenForElement@Document@WebCore@@QAEXPAVElement@2@@Z
?userPreferredLanguages@WebCore@@YA?AV?$Vector@VString@WTF@@$0A@@WTF@@XZ
?utf8@String@WTF@@QBE?AVCString@2@_N@Z
?view@Document@WebCore@@QBEPAVFrameView@2@XZ
- ?nullInstance@TreeScope@WebCore@@SAPAV12@XZ
?nodesFromRect@Document@WebCore@@QBE?AV?$PassRefPtr@VNodeList@WebCore@@@WTF@@HHIIII_N0@Z
?selectionStartHasMarkerFor@Editor@WebCore@@QBE_NW4MarkerType@DocumentMarker@2@HH@Z
?restrictScaleFactorToInitialScaleIfNotUserScalable@WebCore@@YAXAAUViewportAttributes@1@@Z
_ZN7WebCore26ContextDestructionObserverD2Ev;
_ZN7WebCore26ContextDestructionObserverC2EPNS_22ScriptExecutionContextE;
_ZN7WebCore26ContextDestructionObserver16contextDestroyedEv;
-_ZN7WebCore9TreeScope12nullInstanceEv;
local:
_Z*;
cti*;