[Refactoring] Replace Node's Document pointer with a TreeScope pointer
https://bugs.webkit.org/show_bug.cgi?id=59816

Reviewed by Ryosuke Niwa.

.:

* Source/autotools/symbols.filter: Added newly exported symbols.

Source/WebCore:

Before this change, Node::treeScope() fetches the TreeScope object
from ElementRareData. This approach has several shortcomings:

- rareData() call is slow due to a hashtable lookup.
- In shadow tree, each node has its tree scope in ElementRareData,
  that means the rare-data is no longer rare in that case.

This change gets rid of ElementRareData::m_treeScope by replacing
Node::m_document with Node::m_treeScope. And retrieves the
document of Node through m_treeScope.

Note that Node::document() is a hot function and naive
replacemennt of m_document with m_treeScope can hurt the
speed. This change employs some tricks to address it.

- This change introduces Node::InShadowTree flag, if the flag is off,
  that means m_treeScope is actually a document an can be returned as the result.
  this eliminates an extract dereference.
- Node::m_treeScope can be null. But we don't want to issue any extra
  conditional statement. So this change represents a null
  TreeScope as TreeScope::nullInstance(), which saves one conditional
  statement.

With these changes, the Node::document() slowdown is minimized to
unnoticeable size.

No new tests. Covered by existing tests.

* dom/Document.cpp: Took care of connectio betwen TreeScope.
(WebCore::Document::Document):
(WebCore::Document::~Document):
(WebCore::Document::suggestedMIMEType):
* dom/Document.h:
(WebCore::Node::treeScope): Now just return m_treeScope, taking care of nullInstance() case.
(WebCore):
(WebCore::Node::setTreeScope): Now just sets m_treeScope.
(WebCore::Node::documentInternal): Extracted from document() to have ASSERT-free version.
(WebCore::Node::document): Re-implemented over treeScope() and the flag.
(WebCore::Node::isDocumentNode): Re-implemented using treeScope()
(WebCore::Node::Node):
* dom/Node.cpp:
(WebCore::Node::~Node):
(WebCore::Node::reportMemoryUsage):
* dom/Node.h:
(Node):
(WebCore::Node::inDocument):
(WebCore::Node::isInShadowTree): Rewrote to use InShadowTree flag.
* dom/NodeRareData.h:
(WebCore::NodeRareData::NodeRareData): Eliminated m_treeScope.
(NodeRareData):
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::ShadowRoot):
* dom/TreeScope.cpp:
(WebCore::TreeScope::TreeScope):
(WebCore):
(WebCore::TreeScope::setParentTreeScope): Added.
(WebCore::TreeScope::isDocumentScope): Added.
(WebCore::TreeScope::nullInstance): Added.
* dom/TreeScope.h: Added m_parentTreeScope.
(WebCore):
(WebCore::TreeScope::rootDocument): Added.
(TreeScope):
* dom/TreeScopeAdopter.cpp: No longer calls setDocument()
(WebCore::TreeScopeAdopter::moveTreeToNewScope):
(WebCore::TreeScopeAdopter::moveNodeToNewDocument):
* editing/MoveSelectionCommand.cpp: Includes Document.h to find inlined Node functions
* editing/RemoveNodeCommand.cpp: Includes Document.h to find inlined Node functions
* editing/RemoveNodePreservingChildrenCommand.cpp: Includes Document.h to find inlined Node functions
* inspector/PageConsoleAgent.cpp: Includes Document.h to find inlined Node functions

Source/WebKit2:

* win/WebKit2.def: Added newly exported symbols.
* win/WebKit2CFLite.def: Ditto.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Compile WebCore without QtWidgets
https://bugs.webkit.org/show_bug.cgi?id=91819

Patch by Simon Hausmann <simon.hausmann@nokia.com> on 2012-07-19
Reviewed by Kenneth Rohde Christiansen.

* WebCore.pri: QT += opengl is not needed for Qt 5, given that QtGui has OpenGL
support built in with the QOpenGL* classes.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123185 268f45cc-cd09-0410-ab3c-d52691b4dbfc