[iOS] [Media] Prevent page zoom if it started in the video element
https://bugs.webkit.org/show_bug.cgi?id=134640
<rdar://problem/16630794>

Reviewed by Sam Weinig.

In r170572 I attempted to prevent the page zoom from happening
when the user was attempting to fullscreen the video. That fix was
not complete, because it relied on the touchstart event being
sent before a gesture event. It turns out this doesn't always happen,
so we need to apply the same check in the gesture event - if the
gesture began with two fingers on the media, don't do a page zoom.
The exception is zooming out, if you've managed to make the video
cover the entire screen (also, the pinch-out-of-fullscreen gesture
does not get handled by WebKit).

* Modules/mediacontrols/mediaControlsiOS.js:
(ControllerIOS.prototype.handleBaseGestureChange): Add a check to
make sure our pinch didn't start in the video element.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170815 268f45cc-cd09-0410-ab3c-d52691b4dbfc
QualifiedName should use RefPtr<QualifiedNameImpl> internally.
<https://webkit.org/b/132796>

We were not inlining ~QualifiedName() and it was showing up in some
profiles (over 1% on dom-attr.html.)

This patch modernizes QualifiedName a bit by using RefPtr to store
the QualifiedNameImpl instead of doing manual ref() and deref()
in out-of-line functions.

Reviewed by Darin Adler.

* WebCore.exp.in:
* dom/QualifiedName.cpp:
(WebCore::QNameComponentsTranslator::translate):
(WebCore::QualifiedName::QualifiedName):
(WebCore::QualifiedName::~QualifiedName): Deleted.
(WebCore::QualifiedName::deref): Deleted.
* dom/QualifiedName.h:
(WebCore::QualifiedName::QualifiedNameImpl::create):
(WebCore::QualifiedName::QualifiedName):
(WebCore::QualifiedName::isHashTableDeletedValue):
(WebCore::QualifiedName::~QualifiedName):
(WebCore::QualifiedName::operator=):
(WebCore::QualifiedName::impl):
(WebCore::QualifiedName::ref): Deleted.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170816 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Subpixel rendering: ebay.com rotating billboard on the main page has cut off buttons.
https://bugs.webkit.org/show_bug.cgi?id=134636
<rdar://problem/17529112>

Reviewed by Darin Adler.

Missing pixel snapping when clipping the transparency layer for BackgroundBleedUseTransparencyLayer.
Clipping needs to take the same snapping strategy as the rest of the painting code.

Source/WebCore:
Test: fast/borders/border-radius-on-subpixel-position-non-hidpi.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::paintBoxDecorations):

LayoutTests:
* fast/borders/border-radius-on-subpixel-position-non-hidpi-expected.html: Added.
* fast/borders/border-radius-on-subpixel-position-non-hidpi.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170817 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fast path for jsStringWithCache() when asked for the same string repeatedly.
<https://webkit.org/b/134635>

Source/JavaScriptCore:
Also moved the whole thing from WebCore to JavaScriptCore since it
makes more sense here, and inline the lightweight checks, leaving only
the hashmap stuff out of line.

Reviewed by Darin Adler.

* runtime/JSString.cpp:
(JSC::jsStringWithCacheSlowCase):
* runtime/JSString.h:
(JSC::jsStringWithCache):
* runtime/VM.h:

Source/WebCore:
Reviewed by Darin Adler.

* WebCore.exp.in:
* bindings/js/JSDOMBinding.cpp:
(WebCore::jsStringWithCache): Deleted.
* bindings/js/JSDOMBinding.h:
(WebCore::JSValueTraits<String>::arrayJSValue):
(WebCore::jsStringWithCache): Deleted.
* bridge/c/c_utility.cpp:
(JSC::Bindings::convertNPVariantToValue):
* loader/cache/CachedResourceHandle.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170818 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][WK2] Enhance the Minibrowser to show selected/highlighted text in search bar, if any.
https://bugs.webkit.org/show_bug.cgi?id=134485

Patch by Shivakumar JM <shiva.jm@samsung.com> on 2014-07-04
Reviewed by Gyuyoung Kim.

Use script_execute_callback to get selected/highlighted text and show in search bar.

* MiniBrowser/efl/main.c:
(script_execute_callback):
(on_key_down):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170820 268f45cc-cd09-0410-ab3c-d52691b4dbfc
CSS JIT: compile :in-range and :out-of-range
https://bugs.webkit.org/show_bug.cgi?id=134639

Reviewed by Andreas Kling.

The pseudo class :in-range and :out-of-range are trivial non-inlined selectors.

* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOne):
* css/SelectorCheckerTestFunctions.h:
(WebCore::isInRange):
(WebCore::isOutOfRange):
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::addPseudoClassType):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170822 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Support Geolocation
https://bugs.webkit.org/show_bug.cgi?id=134439

Reviewed by Antonio Gomes.

.:
* Source/cmake/OptionsEfl.cmake: Turn on ENABLE_GEOLOCATION.

Source/WebCore:
Add geoclue files in order to enable geolocation for EFL port.

* PlatformEfl.cmake:

Tools:
* Scripts/webkitperl/FeatureList.pm: Enable geolocation for EFL port.

LayoutTests:
* platform/efl/TestExpectations: Unskip geolocation tests.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170823 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Add libgeoclue-dev to Tools/efl/install-dependencies.
https://bugs.webkit.org/show_bug.cgi?id=134648

Patch by KwangHyuk Kim <hyuki.kim@samsung.com> on 2014-07-05
Reviewed by Gyuyoung Kim.

As Geoclue is enabled for EFL, libgeoclue-dev is also added to Tools/efl/install-dependencies.

* efl/install-dependencies:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Generate isMathMLFoo() toMathMLFoo() by using NODE_TYPE_CASTS macro and generateTypeHelpers
https://bugs.webkit.org/show_bug.cgi?id=134647

Reviewed by Andreas Kling.

Use type cast macro and generation tag for isFoo() and toFoo() in some MathML classes.

No new tests, no behavior change.

* mathml/MathMLElement.h: Place MathMLElementTypeHelpers.h to the bottom of the
file so that functions from that file can use the Element|Node classes and other things defined in this file.
(WebCore::isMathMLElement): Deleted.
* mathml/MathMLMencloseElement.h:
(WebCore::toMathMLMencloseElement): Deleted.
* mathml/mathtags.in:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170825 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r170825.
https://bugs.webkit.org/show_bug.cgi?id=134653

broke debug builds (Requested by kling on #webkit).

Reverted changeset:

"Generate isMathMLFoo() toMathMLFoo() by using NODE_TYPE_CASTS
macro and generateTypeHelpers"
https://bugs.webkit.org/show_bug.cgi?id=134647
http://trac.webkit.org/changeset/170825

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170826 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS] MediaDocument should set a viewport
https://bugs.webkit.org/show_bug.cgi?id=134658
<rdar://problem/17552339>

Reviewed by Zalan Bujtas.

A MediaDocument should fill the viewport, so set its
initial-scale to 1 and make it non-zoomable.

* html/MediaDocument.cpp:
(WebCore::MediaDocumentParser::createDocumentStructure): Create
a <head> element and a <meta> element with a 1:1 viewport.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170827 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Inline Node's rare data getters.
<https://webkit.org/b/134652>

There was a fair bit of overhead when calling Node::ensureRareData()
from Document's collection getters. This patch inlines the case where
we've already materialized the rare data.

Reviewed by Antti Koivisto.

* dom/Node.cpp:
(WebCore::Node::materializeRareData):
(WebCore::Node::rareData): Deleted.
(WebCore::Node::ensureRareData): Deleted.
* dom/Node.h:
* dom/NodeRareData.h:
(WebCore::Node::rareData):
(WebCore::Node::ensureRareData):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170828 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Inline NodeListsNodeData helpers more aggressively.
<https://webkit.org/b/134654>

Get rid of call overhead costs when retrieving NodeLists and
HTMLCollections from Document. These functions have very few clients,
so there's no real reason to keep them out of line.

Reviewed by Antti Koivisto.

* dom/NodeRareData.h:
(WebCore::NodeListsNodeData::addCacheWithAtomicName):
(WebCore::NodeListsNodeData::addCacheWithName):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170829 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Don't throttle layer flushes when the main resource is a GIF
https://bugs.webkit.org/show_bug.cgi?id=134650

Source/WebCore: 
<rdar://problem/17490712>

Reviewed by Simon Fraser.
        
Avoid throttling big image animations.

* page/FrameView.cpp:
(WebCore::determineLayerFlushThrottleState):
        
    Disable for image documents.

(WebCore::FrameView::disableLayerFlushThrottlingTemporarilyForInteraction):
(WebCore::FrameView::updateLayerFlushThrottling):
        
    Refactor a bit.

* page/LayerFlushThrottleState.h:
        
    Rename the flag.

Source/WebKit2: 

Reviewed by Simon Fraser.

* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::adjustLayerFlushThrottling):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170830 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Speculative fix for: NetworkProcess sometimes hangs under copyDefaultCredentialForProtectionSpace
https://bugs.webkit.org/show_bug.cgi?id=134666

Reviewed by Tim Horton.

* Shared/mac/SecItemRequestData.cpp:
(WebKit::SecItemRequestData::encode): Encode whether or not the query dictionary exists.
(WebKit::SecItemRequestData::decode): Only fail when query dictionary fails to decode if we expect one.

* UIProcess/mac/SecItemShimProxy.cpp:
(WebKit::SecItemShimProxy::secItemRequest): If the request is of type Invalid, log an error message asking
  for a bug, and respond with an "invalid parameter" error.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170831 268f45cc-cd09-0410-ab3c-d52691b4dbfc
CSS JIT: Ensure resolvingMode size is 1 byte
https://bugs.webkit.org/show_bug.cgi?id=134662

Reviewed by Benjamin Poulain.

Since selector compiler uses MacroAssembler::branch8 for SelectorChecker::Mode,
we should ensure sizeof(SelectorChecker::Mode) == 1.
Old implementation works only in little endianness environments.

* css/ElementRuleCollector.cpp:
(WebCore::ElementRuleCollector::matchedResult):
(WebCore::ElementRuleCollector::matchedRuleList):
(WebCore::ElementRuleCollector::collectMatchingRules):
(WebCore::ElementRuleCollector::sortAndTransferMatchedRules):
(WebCore::ElementRuleCollector::hasAnyMatchingRules):
* css/ElementRuleCollector.h:
(WebCore::ElementRuleCollector::ElementRuleCollector):
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::match):
(WebCore::SelectorChecker::matchRecursively):
(WebCore::SelectorChecker::checkOne):
* css/SelectorChecker.h:
* css/StyleInvalidationAnalysis.cpp:
(WebCore::invalidateStyleRecursively):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::pseudoStyleRulesForElement):
* css/StyleResolver.h:
(WebCore::checkRegionSelector):
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorCodeGenerator::jumpIfNotResolvingStyle):
(WebCore::SelectorCompiler::elementIsActiveForStyleResolution):
(WebCore::SelectorCompiler::elementIsHoveredForStyleResolution):
* dom/SelectorQuery.cpp:
(WebCore::SelectorDataList::selectorMatches):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170832 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Generate isMathMLFoo() toMathMLFoo() by using NODE_TYPE_CASTS macro and generateTypeHelpers
https://bugs.webkit.org/show_bug.cgi?id=134647

Reviewed by Andreas Kling.

Use type cast macro and generation tag for isFoo() and toFoo() in some MathML classes.

No new tests, no behavior change.

* mathml/MathMLElement.h: Place MathMLElementTypeHelpers.h to the bottom of the
file so that functions from that file can use the Element|Node classes and other things defined in this file.
* mathml/MathMLMencloseElement.h:
(WebCore::toMathMLMencloseElement): Deleted.
* mathml/mathtags.in:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170833 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Flags value of SourceCodeKey should be unique for each case.
https://bugs.webkit.org/show_bug.cgi?id=134435

Patch by Daewoong Jang <daewoong.jang@navercorp.com> on 2014-07-06
Reviewed by Darin Adler.

Different combinations of CodeType and JSParserStrictness could generate same m_flags value because
the value of CodeType and the value of JSParserStrictness shares a bit inside m_flags member variable.
Shift the value of CodeType one bit farther to the left so those values don't overlap.

* runtime/CodeCache.h:
(JSC::SourceCodeKey::SourceCodeKey):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170834 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. Adding myself to committers.

* Scripts/webkitpy/common/config/contributors.json:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170835 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Turn on img@sizes compile flag
https://bugs.webkit.org/show_bug.cgi?id=134634

Reviewed by Benjamin Poulain.

Source/JavaScriptCore:
* Configurations/FeatureDefines.xcconfig: Moved compile flag to alphabetical order.

Source/WebCore:
* Configurations/FeatureDefines.xcconfig: Moved compile flag to alphabetical order.

Source/WebKit:
* mac/Configurations/FeatureDefines.xcconfig: Moved compile flag to alphabetical order.

Source/WebKit2:
* Configurations/FeatureDefines.xcconfig: Moved compile flag to alphabetical order.

Source/WTF:
* wtf/FeatureDefines.h: Added compile flag definition.

Tools:
* Scripts/webkitperl/FeatureList.pm: Turn on the img@sizes feature.

WebKitLibraries:
* win/tools/vsprops/FeatureDefines.props: Added compile flag.

LayoutTests:
* TestExpectations: Turned on layout tests for the img@sizes feature.


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