[EFL] Rebaselining after r158186
https://bugs.webkit.org/show_bug.cgi?id=123571

Unreviewed gardening.

Patch by Krzysztof Wolanski <k.wolanski@samsung.com> on 2013-10-31

* platform/efl/editing/deleting/smart-delete-003-expected.txt: Rebaselining after r158186.
* platform/efl/editing/deleting/smart-delete-004-expected.txt: Rebaselining after r158186.
* platform/efl/editing/selection/after-line-wrap-expected.txt: Rebaselining after r157851.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158358 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Manage SVGPathByteStream through std::unique_ptr
https://bugs.webkit.org/show_bug.cgi?id=123467

Reviewed by Anders Carlsson.

Manage SVGPathByteStream objects through std::unique_ptr. Constructors for the class are made public
so std::make_unique can be used with the class.

* svg/SVGAnimatedPath.cpp:
(WebCore::SVGAnimatedPathAnimator::constructFromString):
(WebCore::SVGAnimatedPathAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedPathAnimator::calculateAnimatedValue):
* svg/SVGAnimatedType.cpp:
(WebCore::SVGAnimatedType::createPath):
* svg/SVGAnimatedType.h:
* svg/SVGPathByteStream.h:
(WebCore::SVGPathByteStream::SVGPathByteStream): Takes a const Data object that's then copied.
(WebCore::SVGPathByteStream::copy): Made const.
* svg/SVGPathByteStreamBuilder.cpp: Remove an unnecessary include.
* svg/SVGPathByteStreamBuilder.h: Ditto.
* svg/SVGPathElement.cpp:
(WebCore::SVGPathElement::SVGPathElement):
* svg/SVGPathElement.h:
* svg/SVGPathUtilities.cpp:
(WebCore::appendSVGPathByteStreamFromSVGPathSeg):
(WebCore::addToSVGPathByteStream):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158359 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WK2][GTK] enable-media-stream Setting
https://bugs.webkit.org/show_bug.cgi?id=123145

Reviewed by Anders Carlsson.

Source/WebCore:

* page/Settings.in: new mediaStreamEnabled setting.

Source/WebKit2:

* Shared/WebPreferencesStore.h: New MediaStreamEnabled boolean preference.
* UIProcess/API/C/WKPreferences.cpp: MediaStreamEnabled getter and
setter functions.
(WKPreferencesSetMediaStreamEnabled):
(WKPreferencesGetMediaStreamEnabled):
* UIProcess/API/C/WKPreferences.h:
* UIProcess/API/gtk/WebKitSettings.cpp: Add a enable-media-stream
property to the GTK WebKitSettings class. It will act as a facade
to the MediaStreamEnabled preference.
(webKitSettingsSetProperty):
(webKitSettingsGetProperty):
(webkit_settings_class_init):
(webkit_settings_get_enable_media_stream):
(webkit_settings_set_enable_media_stream):
* UIProcess/API/gtk/WebKitSettings.h:
* UIProcess/API/gtk/docs/webkit2gtk-sections.txt:
* UIProcess/API/gtk/tests/TestWebKitSettings.cpp:
(testWebKitSettings): Test enable-media-stream websetting.
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
Allow WKTR to override the MediaStreamEnabled preference.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences): Update MediaStreamEnabled
along with the other settings.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158360 268f45cc-cd09-0410-ab3c-d52691b4dbfc
CryptoAlgorithmDescriptionBuilder should support producing nested algorithms
https://bugs.webkit.org/show_bug.cgi?id=123461

Reviewed by Darin Adler.

To add a nested algorithm, clone a builder with createEmptyClone(), fill it,
and add it using add().

* bindings/js/JSCryptoAlgorithmBuilder.h:
* crypto/CryptoAlgorithmDescriptionBuilder.h:
* bindings/js/JSCryptoAlgorithmBuilder.cpp:
(WebCore::JSCryptoAlgorithmBuilder::createEmptyClone):
(WebCore::JSCryptoAlgorithmBuilder::add): Keep VM in a local variable for marginally
better performance.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158361 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r158333): http/tests/xmlhttprequest/response-encoding.html and xmlhttprequest-overridemimetype-content-type-header.html are failing
https://bugs.webkit.org/show_bug.cgi?id=123548

Reviewed by Brady Eidson.

Source/WebCore:

We had code that made sure that cached 200 responses weren't used for conditional
requests. But it didn't work the other way - cached 304 responses got reused for
subsequent unconditional requests!

Adding the test uncovered this bug.

* loader/cache/CachedRawResource.cpp: (WebCore::shouldIgnoreHeaderForCacheReuse):
Should never ignore conditional headers. Code in determineRevalidationPolicy
was already undoing this for conditional requests, but we also shouldn't use
WebCore cache if it holds a 304 response to conditional request.

* loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::determineRevalidationPolicy):
Even though the changed code is only for raw resources, I think that we can never
get a conditional request here any more.

LayoutTests:

* TestExpectations: Unskip tests that used to be affected by response-empty-arraybuffer.html

* http/tests/xmlhttprequest/response-empty-arraybuffer-expected.txt:
* http/tests/xmlhttprequest/response-empty-arraybuffer.html:
Fix a stupid typo. This test actually fully passes.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158362 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add a crypto algorithm abstraction
https://bugs.webkit.org/show_bug.cgi?id=123474

Reviewed by Sam Weinig.

This works slightly differently than WebCrypto implies. We have separate classes
for algorithm and its parameters, while WebCrypto puts them in the same dictionary.

* WebCore.xcodeproj/project.pbxproj: Added new files.

* crypto/CryptoAlgorithm.cpp: Added. As most algorithms don't implement most
operations, default implementations just raise an exception.
* crypto/CryptoAlgorithm.h: Added.

* crypto/CryptoAlgorithmParameters.h: Added. Base class for numerous future parameter
dictionaries, such as HmacParams or HmacKeyParams.

* crypto/CryptoAlgorithmRegistry.cpp: Added.
* crypto/CryptoAlgorithmRegistry.h: Added.
The registry decouples universal bindings code from algorithms that may or may not
be implemented on each platform.

* crypto/mac: Added.
* crypto/mac/CryptoAlgorithmRegistryMac.cpp: Added.
(WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms): Algorithms implemented
on Mac will be registered by this function.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158363 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Paint the input tag of range type on WinCE port.
https://bugs.webkit.org/show_bug.cgi?id=123199

Patch by Zhuang Zhigang <zhuangzg@cn.fujitsu.com> on 2013-10-31
Reviewed by Brent Fulgham.

* rendering/RenderThemeWinCE.cpp:
(WebCore::RenderThemeWinCE::paintSliderTrack):
(WebCore::RenderThemeWinCE::paintSliderThumb):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158364 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Pass ScriptExecutionContext by reference to from the bindings constructors
https://bugs.webkit.org/show_bug.cgi?id=123575

Reviewed by Andreas Kling.

Since we null check the ScriptExecutionContext before creating the c++ class,
we should be passing by reference.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158365 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add bindings code for crypto algorithm dictionaries
https://bugs.webkit.org/show_bug.cgi?id=123476

Reviewed by Sam Weinig.

JSCryptoAlgorithmDictionary reads the Algorithm, much like JSDictionary does in
simpler cases. We should see about bringing them closer together (perhaps replacing
with autogenerated code).

* crypto/parameters: Added.
* crypto/parameters/CryptoAlgorithmHmacKeyParams.h: Added.
* crypto/parameters/CryptoAlgorithmHmacParams.h: Added.
Added a couple specific dictionaries as an example.

* WebCore.xcodeproj/project.pbxproj: Added JSCryptoAlgorithmDictionary.
* bindings/js/JSCryptoAlgorithmDictionary.cpp: Added.
(WebCore::JSCryptoAlgorithmDictionary::getAlgorithmIdentifier):
(WebCore::getHashAlgorithm):
(WebCore::createHmacParams):
(WebCore::createHmacKeyParams):
(WebCore::JSCryptoAlgorithmDictionary::createParametersForSign):
(WebCore::JSCryptoAlgorithmDictionary::createParametersForVerify):
(WebCore::JSCryptoAlgorithmDictionary::createParametersForDigest):
(WebCore::JSCryptoAlgorithmDictionary::createParametersForImportKey):
* bindings/js/JSCryptoAlgorithmDictionary.h: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158366 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix a mis-merge.

* WebCore.xcodeproj/project.pbxproj: Remove duplicate CryptoAlgorithmRegistryMac.cpp.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158367 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Pass an Element by reference to the PseudoElement constructor
https://bugs.webkit.org/show_bug.cgi?id=123576

Reviewed by Andreas Kling.

* dom/Element.cpp:
(WebCore::Element::createPseudoElementIfNeeded):
* dom/PseudoElement.cpp:
(WebCore::PseudoElement::PseudoElement):
* dom/PseudoElement.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158368 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebPageCreationParameters should be consistent in Window.open
https://bugs.webkit.org/show_bug.cgi?id=123557

Reviewed by Sam Weinig.

When Window.open in called in WebKit2 the WebProcess sends a synchronous request to open
a page (WebPageProxy::createNewPage). The UIProcess creates a WebpageProxy, and responds
with instructions to the WebProcess to create the WebPage. The initial creation state of
the WebPage is communicated to the WebProcess via two routes (firstly an asynchronous
WebProcess::CreateWebPage message, and secondly in the synchronous response from
WebPageProxy::createNewPage). Unfortunately these responses are inconsistent with each
other. The creationParameters() for the page are calculated twice, and since the WKView
will be added to a window between the async message being sent and the synchronous reply
being returned the visibility state of the page can change.

To fix the inconsistency we can set the creation parameters at the point that the
WebPageProxy is instantiated. This will result in a functional change that is web
visible, since the page will initially be opened in a hidden/blurred state, and may
later become visible/focussed. This change is consistent with the direction we want to
evolve in. Whilst we will still probably require a synchronous message from the
WebProcess to the UIProcess on Window.open, we'll probably make this return much earlier
– having just created the WebPageProxy, but avoiding blocking the WebProcess over the
client delegate callback that opens the new window.

This fix results in a layout test result change, due to the change in behavior (page is
created blurred, and becomes focussed, resulting in a focus event being fired – rather
than the window opening directly into a focussed state). This is reported as a
progression (test is broken in WebKit1, fixed in WebKit2 after this change). In reality
the test is actually slightly broken in DRT/test-runner – the test runs differently than
in browser, since there is is no visible main window. In-browser this patch results in
no change in behavior on dom/Window/mozilla-focus-blur.html (the affected test).

Source/WebKit2: 

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::initializeWebPage):
    - call initializeCreationParameters
(WebKit::WebPageProxy::initializeCreationParameters):
    - calculate m_creationParameters
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::creationParameters):
    - Added m_creationParameters, initializeCreationParameters,
      creationParameters returns m_creationParameters

LayoutTests: 

* platform/mac-wk2/fast/dom/Window: Added.
* platform/mac-wk2/fast/dom/Window/mozilla-focus-blur-expected.txt: Added.
    - This test now reports a pass on WebKit2



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158369 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WIN] Make WebHistory compile without USE(CF)
https://bugs.webkit.org/show_bug.cgi?id=122010

Reviewed by Brent Fulgham.

Add an alternative code path for !USE(CF) to be able to
compile WebHistory without the CoreFoundation library.

* COMVariantSetter.h: Add support for setting a Vector.
* WebHistory.cpp:
(createUserInfoFromArray):
(createUserInfoFromHistoryItem):
(WebHistory::removeAllItems):
(WebHistory::removeItem):
(WebHistory::addItem):
(WebHistory::visitedURL):
* WebHistory.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158370 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-31  Geoffrey Garen  <ggaren@apple.com>

        Added Mark Lam as a reviewer.

        Unreviewed.

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



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158371 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Change WebPage, WebPageProxy, WebPageCreationParameters to use ViewState
https://bugs.webkit.org/show_bug.cgi?id=123379

Reviewed by Darin Adler.

Visibility state of the Page should be stored and communicated consistently.

Remove individual visibility flags from WebPageProxy, WebPageCreationParameters,
and replace them with a ViewState, and add a ViewState member to WebPage.
Merge together all messages that convey and individual aspect of the ViewState.

Restructure WebPageProxy::viewStateDidChange to break the operation down into
three steps: 1) update m_viewState, 2) send the new ViewState to the WebProcess,
and 3) perform any further work necessary in the UIProcess.

This patch fixes a problem that if the web process crashes m_isVisible &
m_isInWindow in WebPageProxy were not updated, and could have held stale values
on reattach.

In WebPage, add a new message to update the entire ViewState - diff the prior
value against the new one to detect changes, call existing methods accordingly.

* Shared/ViewState.h:
    - Add constants 'Reset', 'AllFlags'
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
    - Removed boolean visibility flags, added viewState.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
    - Constructor calls updateViewState to initialize m_viewState.
(WebKit::WebPageProxy::reattachToWebProcess):
    - ViewStaet is not updated while detatched; recalculate.
(WebKit::WebPageProxy::initializeWebPage):
    - m_isVisible -> isViewVisible()
(WebKit::WebPageProxy::updateViewState):
    - Added, update m_viewState by querying the page client.
(WebKit::WebPageProxy::viewStateDidChange):
    - Restructured to use m_viewState, reordered to combine messages.
(WebKit::WebPageProxy::creationParameters):
    - Removed boolean visibility flags, added viewState.
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::isInWindow):
(WebKit::WebPageProxy::isViewVisible):
    - Removed boolean visibility flags, added viewState.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
    - initial state now passed as a ViewState.
(WebKit::WebPage::setIsInWindow):
    - Remove code to send reply (this is handled by setViewState).
(WebKit::WebPage::setViewState):
    - Set m_viewState - diff from prior & call methods to update.
* WebProcess/WebPage/WebPage.h:
    - Added setViewState, m_viewState.
* WebProcess/WebPage/WebPage.messages.in:
    - Add SetViewState, remove individual messages.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
    - initial state now passed as a ViewState.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158372 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Run tests as if they are expected to pass when --force is given.
https://bugs.webkit.org/show_bug.cgi?id=112890

Patch by Tamas Gergely <gertom@inf.u-szeged.hu> on 2013-10-31
Reviewed by Ryosuke Niwa.

The --force switch of new-run-webkit-tests is now forces all tests to
be run with 'PASS' as expected result.

* Scripts/webkitpy/layout_tests/controllers/manager.py:
(Manager.run):
* Scripts/webkitpy/layout_tests/models/test_expectations.py:
(TestExpectations.__init__):
(TestExpectations._add_expectations):
* Scripts/webkitpy/layout_tests/run_webkit_tests.py:
(parse_args):
(_set_up_derived_options):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158373 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, MediaStream build fix after r158365.

* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::clone):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158374 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Repro scrolling crash with scrollbars that use setPresentationValue on the 
scrolling thread
https://bugs.webkit.org/show_bug.cgi?id=123549
-and corresponding-
<rdar://problem/15246606>

Reviewed by Darin Adler.

Speculative fix. I think if we retain the ScrollbarPainters, we should avoid this 
crash.

* page/scrolling/mac/ScrollingTreeScrollingNodeMac.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158375 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, one more build fix after r158365.

* Modules/webaudio/MediaStreamAudioDestinationNode.cpp:
(WebCore::MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158376 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Remove last member variable uses of InspectorState from Agents
https://bugs.webkit.org/show_bug.cgi?id=123540

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2013-10-31
Reviewed by Timothy Hatcher.

* inspector/InspectorDOMDebuggerAgent.h:
* inspector/InspectorDOMDebuggerAgent.cpp:
(WebCore::InspectorDOMDebuggerAgent::InspectorDOMDebuggerAgent):
(WebCore::InspectorDOMDebuggerAgent::setBreakpoint):
(WebCore::InspectorDOMDebuggerAgent::removeBreakpoint):
(WebCore::InspectorDOMDebuggerAgent::pauseOnNativeEventIfNeeded):
(WebCore::InspectorDOMDebuggerAgent::setXHRBreakpoint):
(WebCore::InspectorDOMDebuggerAgent::removeXHRBreakpoint):
(WebCore::InspectorDOMDebuggerAgent::willSendXMLHttpRequest):
DOMDebuggerAgentState::eventListenerBreakpoints -> m_eventListenerBreakpoints.
DOMDebuggerAgentState::xhrBreakpoints -> m_xhrBreakpoints.

* inspector/InspectorDebuggerAgent.h:
* inspector/InspectorDebuggerAgent.cpp:
(WebCore::InspectorDebuggerAgent::InspectorDebuggerAgent):
(WebCore::InspectorDebuggerAgent::disable):
(WebCore::InspectorDebuggerAgent::setBreakpointByUrl):
(WebCore::InspectorDebuggerAgent::removeBreakpoint):
(WebCore::InspectorDebuggerAgent::didParseSource):
DebuggerAgentState::javaScriptBreakpoints -> m_javaScriptBreakpoints.

* inspector/InspectorPageAgent.h:
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::disable):
(WebCore::InspectorPageAgent::addScriptToEvaluateOnLoad):
(WebCore::InspectorPageAgent::removeScriptToEvaluateOnLoad):
(WebCore::InspectorPageAgent::didClearWindowObjectInWorld):
PageAgentState::pageAgentScriptsToEvaluateOnLoad -> m_scriptsToEvaluateOnLoad.
This is a lazily created InspectorObject member variable.

* inspector/InspectorResourceAgent.h:
* inspector/InspectorResourceAgent.cpp:
(WebCore::InspectorResourceAgent::willSendRequest):
(WebCore::InspectorResourceAgent::disable):
(WebCore::InspectorResourceAgent::setExtraHTTPHeaders):
ResourceAgentState::extraRequestHeaders -> m_extraRequestHeaders.
This is a lazily created InspectorObject member variable.

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