Removed incorrect pthread_mutex_trylock code in an ASSERT in TCMalloc_PageHeap::signalScavenger. This
branch is used by the Webkit GTK code.

https://bugs.webkit.org/show_bug.cgi?id=97539

Patch by Mark Toller <mark.toller@samsung.com> on 2012-10-11
Reviewed by Geoffrey Garen.

The code was never compiled in, and was functionally broken. There is no need for locking around the
m_scavengeThreadActive flag, however, we should lock pageheap_lock before calling 'shouldScavenge()', as we
only want to scavenge when really required, so it's better to wait for any current memory operation to
complete before checking.

* wtf/FastMalloc.cpp:
(WTF::TCMalloc_PageHeap::signalScavenger):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131066 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][WK2] NWTR should launch MiniBrowser instead of EWebLauncher after test run
https://bugs.webkit.org/show_bug.cgi?id=99075

Patch by Sudarsana Nagineni <sudarsana.nagineni@intel.com> on 2012-10-11
Reviewed by Kenneth Rohde Christiansen.

Pass the '-2' flag when executing run-launcher script after
testing with WebKitTestRunner.

* Scripts/webkitpy/layout_tests/port/efl.py:
(EflPort.show_results_html_file):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131067 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make ContentSelectorQuery work when siblings are passed explicitly.
https://bugs.webkit.org/show_bug.cgi?id=96990

Reviewed by Dimitri Glazkov.

When we implement content reprojection in ShadowDOM, we have to pass a node pool to SelectorChecker.
We introdue ShadowDOMSiblingTraversalStrategy, which traverses a node pool instead of real node siblings.

Since ContentSelector is a very hot place, we don't want to regress performance. In the previous patch,
we've make ContentSelector::checkOneSelector template to take SiblingTraversalStrategy as an argument.

We also move DOMSiblingTraversalStrategy to SiblingTraversalStrategies.h.

* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* css/SelectorChecker.cpp:
(WebCore):
* css/SelectorChecker.h:
* css/SiblingTraversalStrategies.h: Added.
(WebCore):
(DOMSiblingTraversalStrategy): Moved from SelectorChecker.
(WebCore::DOMSiblingTraversalStrategy::isFirstChild):
(WebCore::DOMSiblingTraversalStrategy::isLastChild):
(WebCore::DOMSiblingTraversalStrategy::isFirstOfType):
(WebCore::DOMSiblingTraversalStrategy::isLastOfType):
(WebCore::DOMSiblingTraversalStrategy::countElementsBefore):
(WebCore::DOMSiblingTraversalStrategy::countElementsOfTypeBefore):
(WebCore::DOMSiblingTraversalStrategy::countElementsAfter):
(WebCore::DOMSiblingTraversalStrategy::countElementsOfTypeAfter):
(WebCore::ShadowDOMSiblingTraversalStrategy::ShadowDOMSiblingTraversalStrategy):
(ShadowDOMSiblingTraversalStrategy): SiblingTraversalStrategy which uses a node pool instead of a real element
siblings. This strategy takes a vector of node which we traverse.
(WebCore::ShadowDOMSiblingTraversalStrategy::isFirstChild):
(WebCore::ShadowDOMSiblingTraversalStrategy::isLastChild):
(WebCore::ShadowDOMSiblingTraversalStrategy::isFirstOfType):
(WebCore::ShadowDOMSiblingTraversalStrategy::isLastOfType):
(WebCore::ShadowDOMSiblingTraversalStrategy::countElementsBefore):
(WebCore::ShadowDOMSiblingTraversalStrategy::countElementsAfter):
(WebCore::ShadowDOMSiblingTraversalStrategy::countElementsOfTypeBefore):
(WebCore::ShadowDOMSiblingTraversalStrategy::countElementsOfTypeAfter):
* css/StyleResolver.cpp:
* html/shadow/ContentDistributor.cpp:
(WebCore::ContentDistributor::distributeSelectionsTo):
* html/shadow/ContentSelectorQuery.cpp: Uses ShadowDOMSiblingTraversalStrategy instead of DOMSiblingTraversalStrategy.
(WebCore::ContentSelectorChecker::ContentSelectorChecker):
(WebCore):
(WebCore::ContentSelectorChecker::checkContentSelector):
(WebCore::ContentSelectorDataList::initialize):
(WebCore::ContentSelectorDataList::matches):
(WebCore::ContentSelectorQuery::ContentSelectorQuery):
(WebCore::ContentSelectorQuery::matches):
* html/shadow/ContentSelectorQuery.h:
(ContentSelectorChecker):
(WebCore):
(ContentSelectorDataList):
(ContentSelectorQuery):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131068 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add missing WK_EXPORT for WKDOMTextIterator.

Rubber-stamped by Brady Eidson.

* WebProcess/InjectedBundle/API/mac/WKDOMTextIterator.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131069 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore: Support re-projection for Shadow DOM.
https://bugs.webkit.org/show_bug.cgi?id=97151

Reviewed by Dimitri Glazkov.

Update node distribution algorithm so that nodes can be re-projected to insertion points
in nested shadow subtree.

See the latest Shadow DOM spec for what 're-projected' means:
- http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html
Also see the related W3C bug:
- http://www.w3.org/Bugs/Public/show_bug.cgi?id=18513

Since this change breaks existing behavior, we have to update several code at once, which includes:
- ContentDistributer: ContentDistributor now re-projects distributed nodes.
- ComposedShadowTreeWalker: ComposedShadowTreeWalker is now aware of re-projection. That can
  resolve re-projection transparently.
- AncestorChainWalker (formerly named ComposedShadowTreeParentWallker):
  AncestorChainWalker is now aware of re-projection. I've also added a crossingInsertionPoint()
  member function so that clients of the walker can know whether the walker is just crossing
  insertion points for a re-projected node.
- EventDispatcher: EventDispatcher now uses the updated AncestorChainWalker and its
  crossingInsertionPoint() so that EventDispatcher can compute relative target for each ancestor correctly.

I've also updated existing layout tests and added some layout tests for re-projection.
Re-projection for multiple shadow root is not supported yet. I'll address that in another bug.

Tests: fast/dom/shadow/composed-shadow-tree-walker.html
       fast/dom/shadow/shadow-dom-event-dispatching.html
       fast/dom/shadow/shadowdom-reprojection-1.html
       fast/dom/shadow/shadowdom-reprojection-2.html

* dom/ComposedShadowTreeWalker.cpp:
(WebCore::resolveReprojection):
(WebCore):
(WebCore::ComposedShadowTreeWalker::traverseSiblingOrBackToInsertionPoint):
(WebCore::ComposedShadowTreeWalker::traverseParent):
(WebCore::AncestorChainWalker::AncestorChainWalker):
(WebCore::AncestorChainWalker::parent):
* dom/ComposedShadowTreeWalker.h:
(AncestorChainWalker):
(WebCore::AncestorChainWalker::crossingInsertionPoint):
* dom/EventDispatcher.cpp:
(WebCore::EventRelatedTargetAdjuster::adjust):
(WebCore::EventDispatcher::ensureEventAncestors):
* dom/TreeScope.cpp:
(WebCore::TreeScope::focusedNode):
* html/HTMLLIElement.cpp:
(WebCore::HTMLLIElement::attach):
* html/shadow/ContentDistributor.cpp:
(WebCore::ContentDistributor::distribute):
* page/EventHandler.cpp:
(WebCore::EventHandler::updateMouseEventTargetNode):

LayoutTests: Update ComposedShadowTreeWalker for Shadow DOM re-projection.
https://bugs.webkit.org/show_bug.cgi?id=97151

Reviewed by Dimitri Glazkov.

* fast/dom/shadow/composed-shadow-tree-walker-expected.txt:
* fast/dom/shadow/composed-shadow-tree-walker.html:
* fast/dom/shadow/resources/shadow-dom.js:
(createShadowRootWithAttributes):
(createDOM):
* fast/dom/shadow/shadow-dom-event-dispatching.html:
* fast/dom/shadow/shadowdom-reprojection-1-expected.html: Added.
* fast/dom/shadow/shadowdom-reprojection-1.html: Added.
* fast/dom/shadow/shadowdom-reprojection-2-expected.html: Added.
* fast/dom/shadow/shadowdom-reprojection-2.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131070 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Always enable the experiments tab for WebKit nightly

Web Inspector: Enabling experiments tab in WebKit nightly.
https://bugs.webkit.org/show_bug.cgi?id=98923

Patch by Mihai Balan <mibalan@adobe.com> on 2012-10-11
Reviewed by Pavel Feldman.

Enabling Web Inspector experiments tab in WebKit nightly. This is done by adding a new
Preference key, Preferences.experimentsEnabled. Default values are true for WebKit and false
for Chromium. They can also be overridden as before (in Chromium)

Source/WebCore:

* inspector/front-end/Settings.js:
(WebInspector.ExperimentsSettings.prototype.get experimentsEnabled):

Source/WebKit/chromium:

* src/js/DevTools.js:

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