WebKit-https.git
6 years agoAdd option to specify output file location in sunspider.
commit-queue@webkit.org [Tue, 8 Jul 2014 09:24:31 +0000 (09:24 +0000)]
Add option to specify output file location in sunspider.
https://bugs.webkit.org/show_bug.cgi?id=134339

Patch by Gergo Balogh <gbalogh.u-szeged@partner.samsung.com> on 2014-07-08
Reviewed by Darin Adler.

PerformanceTests/SunSpider:
* sunspider:

Tools:
* Scripts/run-sunspider:

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

6 years agoUnreviewed. iOS build fix after r170871.
psolanki@apple.com [Tue, 8 Jul 2014 05:56:32 +0000 (05:56 +0000)]
Unreviewed. iOS build fix after r170871.

* rendering/RenderThemeIOS.mm:
(WebCore::adjustInputElementButtonStyle):

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

6 years agoUnreviewed build fix.
achristensen@apple.com [Tue, 8 Jul 2014 05:51:06 +0000 (05:51 +0000)]
Unreviewed build fix.

* WinLauncher/WinLauncher.vcxproj/WinLauncherLib.vcxproj:
Make Common.cpp excluded from both 32-bit and 64-bit builds.

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

6 years agoFix the build after r170876
benjamin@webkit.org [Tue, 8 Jul 2014 04:35:42 +0000 (04:35 +0000)]
Fix the build after r170876

Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-07-07

* assembler/LinkBuffer.cpp:
(JSC::LinkBuffer::linkCode):

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

6 years agoSubpixel rendering: icloud.com password arrow has clipped circle at some window sizes.
zalan@apple.com [Tue, 8 Jul 2014 04:26:24 +0000 (04:26 +0000)]
Subpixel rendering: icloud.com password arrow has clipped circle at some window sizes.
https://bugs.webkit.org/show_bug.cgi?id=134710
<rdar://problem/17545291>

Reviewed by Simon Fraser.

Transparent layer clipping needs device pixel snapping.

Source/WebCore:
Test: fast/layers/wrong-clipping-semi-transparent-layer-on-subpixel-position.html

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::beginTransparencyLayers):

LayoutTests:
* fast/layers/wrong-clipping-semi-transparent-layer-on-subpixel-position-expected.html: Added.
* fast/layers/wrong-clipping-semi-transparent-layer-on-subpixel-position.html: Added.

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

6 years agoLinkBuffer should not keep a reference to the MacroAssembler
benjamin@webkit.org [Tue, 8 Jul 2014 04:23:30 +0000 (04:23 +0000)]
LinkBuffer should not keep a reference to the MacroAssembler
https://bugs.webkit.org/show_bug.cgi?id=134668

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:
In FTL, the LinkBuffer can outlive the MacroAssembler that was used for code generation.
When that happens, the pointer m_assembler points to released memory. That was not causing
issues because the attribute is not used after linking, but that was not particularily
future proof.

This patch refactors LinkBuffer to avoid any lifetime risk. The MacroAssembler is now passed
as a reference, it is used for linking but no reference is ever stored with the LinkBuffer.

While fixing the call sites to use a reference, I also discovered LinkBuffer.h was included
everywhere. I refactored some #include to avoid that.

* assembler/LinkBuffer.cpp:
(JSC::LinkBuffer::copyCompactAndLinkCode):
(JSC::LinkBuffer::linkCode):
* assembler/LinkBuffer.h:
(JSC::LinkBuffer::LinkBuffer):
* bytecode/Watchpoint.cpp:
* dfg/DFGDisassembler.cpp:
* dfg/DFGDisassembler.h:
* dfg/DFGJITCompiler.cpp:
(JSC::DFG::JITCompiler::link):
(JSC::DFG::JITCompiler::linkFunction):
* dfg/DFGOSRExitCompiler.cpp:
* dfg/DFGPlan.cpp:
* dfg/DFGThunks.cpp:
(JSC::DFG::osrExitGenerationThunkGenerator):
(JSC::DFG::osrEntryThunkGenerator):
* ftl/FTLCompile.cpp:
(JSC::FTL::generateICFastPath):
(JSC::FTL::fixFunctionBasedOnStackMaps):
* ftl/FTLJSCall.cpp:
* ftl/FTLJSCall.h:
* ftl/FTLLink.cpp:
(JSC::FTL::link):
* ftl/FTLLowerDFGToLLVM.cpp:
* ftl/FTLOSRExitCompiler.cpp:
(JSC::FTL::compileStub):
* ftl/FTLThunks.cpp:
(JSC::FTL::osrExitGenerationThunkGenerator):
(JSC::FTL::slowPathCallThunkGenerator):
* jit/ArityCheckFailReturnThunks.cpp:
(JSC::ArityCheckFailReturnThunks::returnPCsFor):
* jit/JIT.cpp:
(JSC::JIT::privateCompile):
* jit/JITCall.cpp:
(JSC::JIT::privateCompileClosureCall):
* jit/JITCall32_64.cpp:
(JSC::JIT::privateCompileClosureCall):
* jit/JITDisassembler.cpp:
* jit/JITDisassembler.h:
* jit/JITOpcodes.cpp:
* jit/JITPropertyAccess.cpp:
(JSC::JIT::stringGetByValStubGenerator):
(JSC::JIT::privateCompileGetByVal):
(JSC::JIT::privateCompilePutByVal):
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::stringGetByValStubGenerator):
* jit/RegisterPreservationWrapperGenerator.cpp:
(JSC::generateRegisterPreservationWrapper):
(JSC::registerRestorationThunkGenerator):
* jit/Repatch.cpp:
(JSC::generateByIdStub):
(JSC::tryCacheGetByID):
(JSC::emitPutReplaceStub):
(JSC::emitPutTransitionStub):
(JSC::tryRepatchIn):
(JSC::linkClosureCall):
* jit/SpecializedThunkJIT.h:
(JSC::SpecializedThunkJIT::finalize):
* jit/ThunkGenerators.cpp:
(JSC::throwExceptionFromCallSlowPathGenerator):
(JSC::linkForThunkGenerator):
(JSC::linkClosureCallForThunkGenerator):
(JSC::virtualForThunkGenerator):
(JSC::nativeForGenerator):
(JSC::arityFixup):
* llint/LLIntThunks.cpp:
(JSC::LLInt::generateThunkWithJumpTo):
* yarr/YarrJIT.cpp:
(JSC::Yarr::YarrGenerator::compile):

Source/WebCore:
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorCodeGenerator::compile):

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

6 years agoSubpixel rendering: Inline box decoration rounds to integral.
zalan@apple.com [Tue, 8 Jul 2014 04:13:40 +0000 (04:13 +0000)]
Subpixel rendering: Inline box decoration rounds to integral.
https://bugs.webkit.org/show_bug.cgi?id=134523
<rdar://problem/17530298>

Reviewed by Darin Adler.

This patch removes 2 integral roundings from InlineFlowBox:
1. Border and padding sizes are implicitly integral truncated by the 'int' return type
   of borderLogicalLeft/Right()/paddingLogicalLeft/Right(). It results in losing
   fractional border/padding values.
2. Painting rectangle is explicitly rounded which pushes border and
   other decoration elements to odd device pixel positions on retina displays.
These values get pixel snapped right before calling in to GraphicsContext::*.

Source/WebCore:
Test: fast/inline/hidpi-inline-text-decoration-with-subpixel-value.html

* rendering/InlineBox.h:
(WebCore::InlineBox::frameRect):
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::nodeAtPoint):
(WebCore::InlineFlowBox::paintBoxDecorations):
(WebCore::InlineFlowBox::paintMask):
(WebCore::InlineFlowBox::roundedFrameRect): Deleted.
* rendering/InlineFlowBox.h:
(WebCore::InlineFlowBox::borderLogicalLeft):
(WebCore::InlineFlowBox::borderLogicalRight):
(WebCore::InlineFlowBox::paddingLogicalLeft):
(WebCore::InlineFlowBox::paddingLogicalRight):

LayoutTests:
* fast/inline/hidpi-inline-text-decoration-with-subpixel-value-expected.html: Added.
* fast/inline/hidpi-inline-text-decoration-with-subpixel-value.html: Added.
* platform/mac/css1/formatting_model/inline_elements-expected.txt:

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

6 years ago[EFL] gardening after r170864
commit-queue@webkit.org [Tue, 8 Jul 2014 04:00:27 +0000 (04:00 +0000)]
[EFL] gardening after r170864
https://bugs.webkit.org/show_bug.cgi?id=134713

Unreviewed, EFL gardening.

Patch by Hunseop Jeong <hs85.jeong@samsung.com> on 2014-07-07

* platform/efl/TestExpectations: Report and mark several unexpected image-only failures.

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

6 years agoPass RenderLayer reference instead of pointer to RenderLayer::paintingExtent().
zalan@apple.com [Tue, 8 Jul 2014 03:22:03 +0000 (03:22 +0000)]
Pass RenderLayer reference instead of pointer to RenderLayer::paintingExtent().
https://bugs.webkit.org/show_bug.cgi?id=134714

Reviewed by Simon Fraser.

No change in functionality.

* rendering/RenderLayer.cpp: * -> &
(WebCore::expandClipRectForRegionAndReflection):
(WebCore::expandClipRectForDescendantsAndReflection):
(WebCore::transparencyClipBox):
(WebCore::paintingExtent):
(WebCore::RenderLayer::beginTransparencyLayers):
(WebCore::RenderLayer::paintTransformedLayerIntoFragments):
(WebCore::RenderLayer::hitTestTransformedLayerInFragments):
(WebCore::RenderLayer::paintingExtent): Deleted.
* rendering/RenderLayer.h:

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

6 years agoTurn on accelerated drawing for WebKit2 by default
timothy_horton@apple.com [Tue, 8 Jul 2014 02:40:11 +0000 (02:40 +0000)]
Turn on accelerated drawing for WebKit2 by default
https://bugs.webkit.org/show_bug.cgi?id=134708
<rdar://problem/17584642>

Reviewed by Simon Fraser.

* Shared/WebPreferencesDefinitions.h:
Make Mac match iOS, in that accelerated drawing is on by default.

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

6 years agoRemove misleadingly-named Font::isSVGFont()
mmaxfield@apple.com [Tue, 8 Jul 2014 02:27:14 +0000 (02:27 +0000)]
Remove misleadingly-named Font::isSVGFont()
https://bugs.webkit.org/show_bug.cgi?id=134697

Reviewed by Dean Jackson.

Being a SVG font is a property of the FontData object, not
the Font object. Providing an isSVGFont() function on the
Font class will likely lead to incorrect code and non-obvious
bugs.

No new tests because there is no behavior change.

* platform/graphics/Font.h:
(WebCore::Font::isSVGFont): Deleted.
* platform/graphics/mac/FontMac.mm:
(WebCore::Font::primaryFontDataIsSystemFont):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::constructTextRun):
* rendering/RenderBlock.cpp:
(WebCore::constructTextRunInternal):
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseFor):
* rendering/svg/SVGInlineTextBox.cpp:
(WebCore::SVGInlineTextBox::constructTextRun):
* rendering/svg/SVGTextMetrics.cpp:
(WebCore::SVGTextMetrics::constructTextRun):
(WebCore::SVGTextMetrics::SVGTextMetrics):

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

6 years agoDon't leak _WKRemoteObjectRegistry in WKBrowsingContextController
timothy_horton@apple.com [Tue, 8 Jul 2014 01:56:28 +0000 (01:56 +0000)]
Don't leak _WKRemoteObjectRegistry in WKBrowsingContextController
https://bugs.webkit.org/show_bug.cgi?id=134703

Reviewed by Simon Fraser.

* UIProcess/API/Cocoa/WKBrowsingContextController.mm:
(-[WKBrowsingContextController _remoteObjectRegistry]):
Adoption is important!!

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

6 years agoMove Gamepad index down into PlatformGamepad.
beidson@apple.com [Tue, 8 Jul 2014 01:52:37 +0000 (01:52 +0000)]
Move Gamepad index down into PlatformGamepad.
https://bugs.webkit.org/show_bug.cgi?id=134670

Reviewed by Darin Adler.

PlatformGamepads always have an inherent index anyways.
This will make things easier in all upcoming work.

* Modules/gamepad/Gamepad.cpp:
(WebCore::Gamepad::Gamepad):
* Modules/gamepad/Gamepad.h:

* Modules/gamepad/GamepadManager.cpp:
(WebCore::GamepadManager::platformGamepadConnected):
(WebCore::GamepadManager::platformGamepadDisconnected):
(WebCore::GamepadManager::makeGamepadsVisibileToBlindNavigators):
* Modules/gamepad/GamepadManager.h:

* Modules/gamepad/NavigatorGamepad.cpp:
(WebCore::NavigatorGamepad::gamepadsBecameVisible):
(WebCore::NavigatorGamepad::gamepadConnected):
(WebCore::NavigatorGamepad::gamepadDisconnected):
* Modules/gamepad/NavigatorGamepad.h:

* platform/GamepadProviderClient.h:

* platform/PlatformGamepad.h:
(WebCore::PlatformGamepad::index):
(WebCore::PlatformGamepad::PlatformGamepad):

* platform/mac/HIDGamepad.cpp:
(WebCore::HIDGamepad::HIDGamepad):
* platform/mac/HIDGamepad.h:

* platform/mac/HIDGamepadProvider.cpp:
(WebCore::HIDGamepadProvider::deviceAdded):
(WebCore::HIDGamepadProvider::deviceRemoved):
(WebCore::HIDGamepadProvider::removeGamepadForDevice):
* platform/mac/HIDGamepadProvider.h:

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

6 years agoWeb Inspector: CSS style declaration editor should ignore empty lines when determinin...
jonowells@apple.com [Tue, 8 Jul 2014 01:38:35 +0000 (01:38 +0000)]
Web Inspector: CSS style declaration editor should ignore empty lines when determining prefix whitespace
https://bugs.webkit.org/show_bug.cgi?id=134704

Reviewed by Joseph Pecoraro.

When checking for zero-length prefix whitespace, completely empty lines are now ignored
as these lines are most often used for organizing rules into groups and often have their
whitespace removed due to trailing whitespace removal conventions.

* UserInterface/Views/CSSStyleDeclarationTextEditor.js:

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

6 years ago[UI-side compositing] Support reflections on custom layers like video
simon.fraser@apple.com [Mon, 7 Jul 2014 23:44:58 +0000 (23:44 +0000)]
[UI-side compositing] Support reflections on custom layers like video
https://bugs.webkit.org/show_bug.cgi?id=134701

Reviewed by Tim Horton.

Source/WebCore:

Add a LayerTypeWebGLLayer layer type, and support casting to PlatformCALayerRemoteCustom.

* WebCore.exp.in: Export PlatformCALayerMac::layerTypeForPlatformLayer(CALayer*), and sort.
* platform/graphics/ca/PlatformCALayer.h:
(WebCore::PlatformCALayer::isPlatformCALayerRemoteCustom):
* platform/graphics/ca/mac/PlatformCALayerMac.h:
* platform/graphics/ca/mac/PlatformCALayerMac.mm:
(PlatformCALayerMac::layerTypeForPlatformLayer):
(PlatformCALayerMac::PlatformCALayerMac):
(PlatformCALayerMac::commonInit):

Source/WebKit2:

For video reflections, we have to support cloning of PlatformCALayerRemoteCustom
in the web process. Do so by implementing PlatformCALayerRemoteCustom::clone(),
which does the right gyrations to get AVPlayerLayers cloned, then makes a
new PlatformCALayerRemoteCustom to wrap the new layer. This ends up getting
its own context hosting ID, allowing the clone to show in the UI process.

Attempt to do the same for WebGL, but turn it off because it breaks.

* Shared/mac/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::drawInContext):
* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::encode): Unconditionally encode/decode
the hostingContextID. It will be 0 for most layers.
(WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::decode):
(WebKit::RemoteLayerTreeTransaction::description):
* UIProcess/ios/RemoteLayerTreeHostIOS.mm:
(WebKit::RemoteLayerTreeHost::createLayer):
* UIProcess/mac/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::createLayer):
* WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::create): Creation with a custom PlatformLayer* always
creates a PlatformCALayerRemoteCustom.
(WebKit::PlatformCALayerRemote::clone): Factor some code.
(WebKit::PlatformCALayerRemote::updateClonedLayerProperties):
(WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
* WebProcess/WebPage/mac/PlatformCALayerRemote.h:
* WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.h:
* WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:
(WebKit::PlatformCALayerRemoteCustom::create):
(WebKit::PlatformCALayerRemoteCustom::PlatformCALayerRemoteCustom):
(WebKit::PlatformCALayerRemoteCustom::clone): Clone by making an instance of the
correct type of platform layer when possible, then wrapping a PlatformCALayerRemoteCustom
around it.
(WebKit::PlatformCALayerRemoteCustom::contents):
(WebKit::PlatformCALayerRemoteCustom::setContents):
* WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
(WebKit::RemoteLayerTreeContext::layerWasCreated):
(WebKit::RemoteLayerTreeContext::layerWillBeDestroyed):

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

6 years agoWeb Inspector: Uncaught Exception debugging iOS 7 NetworkAgent.loadResource is unavai...
commit-queue@webkit.org [Mon, 7 Jul 2014 23:44:58 +0000 (23:44 +0000)]
Web Inspector: Uncaught Exception debugging iOS 7 NetworkAgent.loadResource is unavailable
https://bugs.webkit.org/show_bug.cgi?id=134689

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2014-07-07
Reviewed by Darin Adler.

Gracefully handle if NetworkAgent.loadResource is unavailable.

* UserInterface/Controllers/SourceMapManager.js:
(WebInspector.SourceMapManager.prototype._loadAndParseSourceMap):
* UserInterface/Models/SourceMapResource.js:

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

6 years ago[UI-side compositing] Crash when starting a filter transition on a reflected layer
simon.fraser@apple.com [Mon, 7 Jul 2014 23:44:49 +0000 (23:44 +0000)]
[UI-side compositing] Crash when starting a filter transition on a reflected layer
https://bugs.webkit.org/show_bug.cgi?id=134694

Reviewed by Tim Horton.

Source/WebCore:

Don't call the owner if we failed to find the animation key (which actually
isn't used by PlatformCALayerMac anyway).

* platform/graphics/ca/mac/PlatformCALayerMac.mm:
(-[WebAnimationDelegate animationDidStart:]):

Source/WebKit2:

When cloned layers had animations, we would fire two animationDidStart callbacks,
but the second would pass an empty animationKey string to the web process, resulting
in a crash.

Fix by not blindly copying all layer properties when cloning PlatformCALayerRemotes,
since the clone would include addedAnimations, and then get the same animations
added on top by the caller.

Also protect against an empty animation key in the animationDidStart callback.

* UIProcess/mac/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::animationDidStart):
* WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::PlatformCALayerRemote):
(WebKit::PlatformCALayerRemote::clone): Don't copy all the properties; copy
them manually as PlatformCALayerMac does. Only copy the big things if they don't
have their default values.
(WebKit::PlatformCALayerRemote::copyFiltersFrom): Need an implementation of this
for clone() to call.

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

6 years agoHave MiniBrowser log and reload if the Web Content Process crashes
simon.fraser@apple.com [Mon, 7 Jul 2014 23:44:42 +0000 (23:44 +0000)]
Have MiniBrowser log and reload if the Web Content Process crashes
https://bugs.webkit.org/show_bug.cgi?id=134691

Reviewed by Tim Horton.

Implement _webViewWebProcessDidCrash, log and reload when the web process
crashes.

* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController _webViewWebProcessDidCrash:]):

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

6 years agoNearly everything in the UIProcess "leaks" when WKWebView is torn down
timothy_horton@apple.com [Mon, 7 Jul 2014 23:18:21 +0000 (23:18 +0000)]
Nearly everything in the UIProcess "leaks" when WKWebView is torn down
https://bugs.webkit.org/show_bug.cgi?id=134699
<rdar://problem/17581777>

Reviewed by Simon Fraser.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView initWithFrame:configuration:]):
Adoption is important!

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

6 years agoREGRESSION(iOS WK2): arrow keys movements don't work.
enrica@apple.com [Mon, 7 Jul 2014 21:42:53 +0000 (21:42 +0000)]
REGRESSION(iOS WK2): arrow keys movements don't work.
https://bugs.webkit.org/show_bug.cgi?id=134561
<rdar://problem/16827629>

Reviewed by Benjamin Poulain.

This change add the implementations for cursor movement selectors.
It also provides a mechanism to ensure that every selection
change in WebKit is reflected in UIKit so that it can update the
autocorrection data. This way we ensure that the autocorraction state
is consistent even when selection changes are originated by JavaScript.
WebPageProxy::editorStateChanged now notifies the page client when the
selection is about to change as well as when it actually changed.

* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::editorStateChanged):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::selectionWillChange):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView cut:]): Removed incorrect calls to textWillChange and
textDidChange.
(-[WKContentView paste:]):
(-[WKContentView _moveUp:withHistory:]):
(-[WKContentView _moveDown:withHistory:]):
(-[WKContentView _moveLeft:withHistory:]):
(-[WKContentView _moveRight:withHistory:]):
(-[WKContentView _moveToStartOfWord:withHistory:]):
(-[WKContentView _moveToStartOfParagraph:withHistory:]):
(-[WKContentView _moveToStartOfLine:withHistory:]):
(-[WKContentView _moveToStartOfDocument:withHistory:]):
(-[WKContentView _moveToEndOfWord:withHistory:]):
(-[WKContentView _moveToEndOfParagraph:withHistory:]):
(-[WKContentView _moveToEndOfLine:withHistory:]):
(-[WKContentView _moveToEndOfDocument:withHistory:]):
(-[WKContentView _selectionWillChange]):
(-[WKContentView _selectionChanged]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::notifySelectionWillChange):

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

6 years agoFast path for jsStringWithCache() when asked for the same string repeatedly.
akling@apple.com [Mon, 7 Jul 2014 21:06:15 +0000 (21:06 +0000)]
Fast path for jsStringWithCache() when asked for the same string repeatedly.
<https://webkit.org/b/134635>

Reviewed by Darin Adler.

Follow-up to r170818 addressing a review comment by Geoff Garen.

* runtime/JSString.cpp:
(JSC::jsStringWithCacheSlowCase):

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

6 years agoAdd SPI for saving and restoring a WKWebView's _WKSessionState
andersca@apple.com [Mon, 7 Jul 2014 20:52:49 +0000 (20:52 +0000)]
Add SPI for saving and restoring a WKWebView's _WKSessionState
https://bugs.webkit.org/show_bug.cgi?id=134693

Reviewed by Dan Bernstein.

* UIProcess/API/C/WKPage.cpp:
(WKPageRestoreFromSessionState):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _sessionState]):
(-[WKWebView _restoreFromSessionStateData:]):
(-[WKWebView _restoreFromSessionState:]):
(-[WKWebView _restoreSessionState:andNavigate:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/Cocoa/_WKSessionState.mm:
(-[_WKSessionState _initWithSessionState:]):
* UIProcess/API/Cocoa/_WKSessionStateInternal.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::restoreFromSessionState):
* UIProcess/WebPageProxy.h:

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

6 years agoAdd a stubbed out _WKSessionState class
andersca@apple.com [Mon, 7 Jul 2014 20:28:13 +0000 (20:28 +0000)]
Add a stubbed out _WKSessionState class
https://bugs.webkit.org/show_bug.cgi?id=134690

Reviewed by Geoffrey Garen.

* UIProcess/API/Cocoa/_WKSessionState.h: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
* UIProcess/API/Cocoa/_WKSessionState.mm: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
(-[_WKSessionState initWithData:]):
(-[_WKSessionState data]):
* UIProcess/API/Cocoa/_WKSessionStateInternal.h: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
* UIProcess/Cocoa/SessionStateCoding.h: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
* UIProcess/Cocoa/SessionStateCoding.mm: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
(WebKit::encodeSessionState):
(WebKit::decodeSessionState):
* UIProcess/LegacySessionStateCoding.h:
* WebKit2.xcodeproj/project.pbxproj:

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

6 years agoSome of the WKPreferences (API) property getters read like questions
andersca@apple.com [Mon, 7 Jul 2014 19:52:26 +0000 (19:52 +0000)]
Some of the WKPreferences (API) property getters read like questions
https://bugs.webkit.org/show_bug.cgi?id=134678
<rdar://problem/17576847>

Reviewed by Dan Bernstein.

* UIProcess/API/Cocoa/WKPreferences.h:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences javaScriptIsEnabled]):
(-[WKPreferences javaIsEnabled]):
(-[WKPreferences plugInsAreEnabled]):
(-[WKPreferences isJavaScriptEnabled]): Deleted.
(-[WKPreferences isJavaEnabled]): Deleted.
(-[WKPreferences arePlugInsEnabled]): Deleted.

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

6 years agoServicesOverlayController menus show up in the wrong place.
beidson@apple.com [Mon, 7 Jul 2014 18:50:53 +0000 (18:50 +0000)]
ServicesOverlayController menus show up in the wrong place.
<rdar://problem/17130576> and https://bugs.webkit.org/show_bug.cgi?id=134684

Reviewed by Tim Horton.

* WebProcess/WebPage/mac/ServicesOverlayController.mm:
(WebKit::ServicesOverlayController::selectedTelephoneNumberRangesChanged): Handle cases where
  the telephone number is in a subframe.
(WebKit::ServicesOverlayController::handleClick): The click point is always in main frame document
  coordinates, so convert it to window coordinates using the main frame’s FrameView.

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

6 years agoAdd missing ENABLE(FTL_JIT) guards
commit-queue@webkit.org [Mon, 7 Jul 2014 18:31:38 +0000 (18:31 +0000)]
Add missing ENABLE(FTL_JIT) guards
https://bugs.webkit.org/show_bug.cgi?id=134680

Patch by Tibor Meszaros <tmeszaros.u-szeged@partner.samsung.com> on 2014-07-07
Reviewed by Darin Adler.

* ftl/FTLDWARFDebugLineInfo.cpp:
* ftl/FTLDWARFDebugLineInfo.h:
* ftl/FTLGeneratedFunction.h:

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

6 years ago[iOS WebGL] Fix crash with too many nested glsl functions.
commit-queue@webkit.org [Mon, 7 Jul 2014 18:21:15 +0000 (18:21 +0000)]
[iOS WebGL] Fix crash with too many nested glsl functions.
https://bugs.webkit.org/show_bug.cgi?id=134683
<rdar://problem/17541529>

Patch by Alex Christensen <achristensen@webkit.org> on 2014-07-07
Reviewed by Geoffrey Garen.

This fixes the Khronos WebGL 1.0.3 test nested-functions-should-not-crash.html.

* platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
(WebCore::Extensions3DOpenGLCommon::getTranslatedShaderSourceANGLE):
Add SH_LIMIT_CALL_STACK_DEPTH to extraCompileOptions.

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

6 years agoupdate-webkitgtk-libs script fails by unsatisfied dependencies
berto@igalia.com [Mon, 7 Jul 2014 18:18:59 +0000 (18:18 +0000)]
update-webkitgtk-libs script fails by unsatisfied dependencies
https://bugs.webkit.org/show_bug.cgi?id=134547

Reviewed by Martin Robinson.

Install libxcb-xfixes0-dev, needed to build Mesa.

* gtk/install-dependencies:

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

6 years agoAdd test to ensure that SVGDocumentExtensions::rebuildElements() doesn't rebuild...
dbates@webkit.org [Mon, 7 Jul 2014 17:52:29 +0000 (17:52 +0000)]
Add test to ensure that SVGDocumentExtensions::rebuildElements() doesn't rebuild invalid elements
https://bugs.webkit.org/show_bug.cgi?id=134417
<rdar://problem/17479854>

Reviewed by David Kilzer.

Add a test that implicitly checks that the list of SVG elements to be rebuilt doesn't contain
removed elements. Run this test in DRT with Guard Malloc/MallocScribble (or the platform-
specific equivalent) enabled.

* svg/custom/overwrite-page-that-has-use-elements-expected.txt: Added.
* svg/custom/overwrite-page-that-has-use-elements.html: Added.

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

6 years agoUnreviewed Mac gardening after r170817.
zalan@apple.com [Mon, 7 Jul 2014 17:20:19 +0000 (17:20 +0000)]
Unreviewed Mac gardening after r170817.

* platform/mac-wk2/TestExpectations:

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

6 years ago[Cocoa] Assertion failure in NavigationState::LoaderClient::didStartProvisionalLoadFo...
mitz@apple.com [Mon, 7 Jul 2014 16:21:10 +0000 (16:21 +0000)]
[Cocoa] Assertion failure in NavigationState::LoaderClient::didStartProvisionalLoadForFrame (navigationID) when navigating through the page cache
https://bugs.webkit.org/show_bug.cgi?id=134682

Reviewed by Tim Horton.

* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::LoaderClient::didStartProvisionalLoadForFrame): Replaced the
assertion with a FIXME.
(WebKit::NavigationState::LoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame):
Ditto.
(WebKit::NavigationState::LoaderClient::didFailProvisionalLoadWithErrorForFrame): Ditto.
(WebKit::NavigationState::LoaderClient::didCommitLoadForFrame): Ditto.
(WebKit::NavigationState::LoaderClient::didFinishDocumentLoadForFrame): Ditto.
(WebKit::NavigationState::LoaderClient::didFinishLoadForFrame): Ditto.
(WebKit::NavigationState::LoaderClient::didFailLoadWithErrorForFrame): Ditto.

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

6 years ago[EFL] Fix cursor artifacts on naver map site.
commit-queue@webkit.org [Mon, 7 Jul 2014 11:48:00 +0000 (11:48 +0000)]
[EFL] Fix cursor artifacts on naver map site.
https://bugs.webkit.org/show_bug.cgi?id=134649

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

Old evas cursor and ecore x cursor are reset before new cursor is applied.

* UIProcess/API/efl/EwkView.cpp:
(EwkView::updateCursor):

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

6 years agoEnable ARMv7 disassembler for the GTK port
zandobersek@gmail.com [Mon, 7 Jul 2014 09:04:03 +0000 (09:04 +0000)]
Enable ARMv7 disassembler for the GTK port
https://bugs.webkit.org/show_bug.cgi?id=134676

Reviewed by Benjamin Poulain.

Source/JavaScriptCore:
* CMakeLists.txt: Add ARMv7DOpcode.cpp file to the build.
* disassembler/ARMv7/ARMv7DOpcode.cpp: Include the string.h header for strlen().

Source/WTF:
* wtf/Platform.h: Enable the ARMv7 disassembler for the GTK port when
targeting the ARMv7 architecture.

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

6 years ago[GTK] Unreviewed GTK gardening.
commit-queue@webkit.org [Mon, 7 Jul 2014 07:38:48 +0000 (07:38 +0000)]
[GTK] Unreviewed GTK gardening.

Remove failure expectations for tests that have been passing after r168046, r168350, r168400,
r168479, r169309, r169620, r169689 and r169799.

Patch by Lorenzo Tilve <ltilve@igalia.com> on 2014-07-07

* platform/gtk/TestExpectations:

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

6 years ago[CSS Blending]The background images set on the root element will blend on an initial...
rosca@adobe.com [Mon, 7 Jul 2014 07:16:04 +0000 (07:16 +0000)]
[CSS Blending]The background images set on the root element will blend on an initial white backdrop.
https://bugs.webkit.org/show_bug.cgi?id=134342

Reviewed by Dean Jackson.

Source/WebCore:
Tests: css3/blending/background-blend-mode-body-image.html
       css3/blending/background-blend-mode-body-transparent-color-and-image.html
       css3/blending/background-blend-mode-body-transparent-image.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::paintFillLayers):
If the background layers have blend modes, we paint the base background color first,
before starting a new transparency layer. After creating the transparency layer,
the base background will be skipped, and the background layers will blend on top of
a transparent backdrop.
(WebCore::RenderBox::paintFillLayer):
* rendering/RenderBox.h:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
This method is able to paint only the base background color (BaseBackgroundColorOnly),
skipping the background-color and background-images. This option is available only
on bottom layer of the root renderer and only if the background color is not opaque,
otherwise the method will return early.
Another option is to paint the root background without using the base background color
(BaseBackgroundColorSkip).
* rendering/RenderBoxModelObject.h:
Adding the BaseBackgroundColorUsage enum.

LayoutTests:
* css3/blending/background-blend-mode-body-image-expected.html: Added.
* css3/blending/background-blend-mode-body-image.html: Added.
* css3/blending/background-blend-mode-body-transparent-color-and-image-expected.html: Added.
* css3/blending/background-blend-mode-body-transparent-color-and-image.html: Added.
* css3/blending/background-blend-mode-body-transparent-image-expected.html: Added.
* css3/blending/background-blend-mode-body-transparent-image.html: Added.

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

6 years ago[iOS][WK2] The tap highlight ID is not invalidated when a long press ends
benjamin@webkit.org [Mon, 7 Jul 2014 06:26:31 +0000 (06:26 +0000)]
[iOS][WK2] The tap highlight ID is not invalidated when a long press ends
https://bugs.webkit.org/show_bug.cgi?id=134660

Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-07-06
Reviewed by Darin Adler.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _cancelInteraction]):
(-[WKContentView _finishInteraction]):
(cancelPotentialTapIfNecessary):
I messed that up in r170600. I only accounted for the web process being too fast.

If the web process is too slow, _cancelInteraction or _finishInteraction happen before
_didGetTapHighlightForRequest:, and we also need to nuke the tap highlight.

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

6 years ago[ARMv7] Use 16 bits instructions for push/pop when possible
benjamin@webkit.org [Mon, 7 Jul 2014 06:24:54 +0000 (06:24 +0000)]
[ARMv7] Use 16 bits instructions for push/pop when possible
https://bugs.webkit.org/show_bug.cgi?id=134656

Reviewed by Andreas Kling.

* assembler/ARMv7Assembler.h:
(JSC::ARMv7Assembler::pop):
(JSC::ARMv7Assembler::push):
(JSC::ARMv7Assembler::ARMInstructionFormatter::oneWordOp7Imm9):
Add the 16 bits version of push and pop.

* assembler/MacroAssemblerARMv7.h:
(JSC::MacroAssemblerARMv7::pop):
(JSC::MacroAssemblerARMv7::push):
Use the new push/pop instead of a regular load/store.

* disassembler/ARMv7/ARMv7DOpcode.cpp:
(JSC::ARMv7Disassembler::ARMv7DOpcode::appendRegisterList):
* disassembler/ARMv7/ARMv7DOpcode.h:
(JSC::ARMv7Disassembler::ARMv7DOpcodeMiscPushPop::registerMask):
Fix the disassembler for push/pop:
-The register mask was on 7 bits for some reason.
-The code printing the registers was comparing a register ID with a register
 mask.

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

6 years ago[WK2] Don't support dynamically enabling the RemoteLayerTree debug indicator
timothy_horton@apple.com [Mon, 7 Jul 2014 06:04:51 +0000 (06:04 +0000)]
[WK2] Don't support dynamically enabling the RemoteLayerTree debug indicator
https://bugs.webkit.org/show_bug.cgi?id=134644

Reviewed by Darin Adler.

* UIProcess/DrawingAreaProxy.h:
(WebKit::DrawingAreaProxy::setShouldShowDebugIndicator): Deleted.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::preferencesDidChange):
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
(WebKit::RemoteLayerTreeDrawingAreaProxy::initializeDebugIndicator):
(WebKit::RemoteLayerTreeDrawingAreaProxy::setShouldShowDebugIndicator): Deleted.
The indicator depends on the live layer tree commits coming in, including layer creation,
so it can't be turned on after the root layer is created. Even a refresh is insufficient
to get it working; the debug indicator really needs to exist from the first commit.
So, don't even attempt to dynamically enable the indicator; create it at
RemoteLayerTreeDrawingAreaProxy construction time if the pref is enabled.

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

6 years agoTurn on img@sizes compile flag
yoav@yoav.ws [Mon, 7 Jul 2014 05:02:34 +0000 (05:02 +0000)]
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: https://svn.webkit.org/repository/webkit/trunk@170837 268f45cc-cd09-0410-ab3c-d52691b4dbfc

6 years agoUnreviewed. Adding myself to committers.
hw1008.kim@samsung.com [Mon, 7 Jul 2014 03:42:46 +0000 (03:42 +0000)]
Unreviewed. Adding myself to committers.

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

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

6 years agoFlags value of SourceCodeKey should be unique for each case.
commit-queue@webkit.org [Mon, 7 Jul 2014 02:06:37 +0000 (02:06 +0000)]
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: https://svn.webkit.org/repository/webkit/trunk@170834 268f45cc-cd09-0410-ab3c-d52691b4dbfc

6 years agoGenerate isMathMLFoo() toMathMLFoo() by using NODE_TYPE_CASTS macro and generateTypeH...
gyuyoung.kim@samsung.com [Mon, 7 Jul 2014 01:22:33 +0000 (01:22 +0000)]
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: https://svn.webkit.org/repository/webkit/trunk@170833 268f45cc-cd09-0410-ab3c-d52691b4dbfc

6 years agoCSS JIT: Ensure resolvingMode size is 1 byte
utatane.tea@gmail.com [Mon, 7 Jul 2014 01:18:17 +0000 (01:18 +0000)]
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: https://svn.webkit.org/repository/webkit/trunk@170832 268f45cc-cd09-0410-ab3c-d52691b4dbfc

6 years agoSpeculative fix for: NetworkProcess sometimes hangs under copyDefaultCredentialForPro...
beidson@apple.com [Mon, 7 Jul 2014 00:01:23 +0000 (00:01 +0000)]
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: https://svn.webkit.org/repository/webkit/trunk@170831 268f45cc-cd09-0410-ab3c-d52691b4dbfc

6 years agoDon't throttle layer flushes when the main resource is a GIF
antti@apple.com [Sun, 6 Jul 2014 20:05:03 +0000 (20:05 +0000)]
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: https://svn.webkit.org/repository/webkit/trunk@170830 268f45cc-cd09-0410-ab3c-d52691b4dbfc

6 years agoInline NodeListsNodeData helpers more aggressively.
akling@apple.com [Sun, 6 Jul 2014 18:03:06 +0000 (18:03 +0000)]
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: https://svn.webkit.org/repository/webkit/trunk@170829 268f45cc-cd09-0410-ab3c-d52691b4dbfc

6 years agoInline Node's rare data getters.
akling@apple.com [Sun, 6 Jul 2014 18:01:06 +0000 (18:01 +0000)]
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: https://svn.webkit.org/repository/webkit/trunk@170828 268f45cc-cd09-0410-ab3c-d52691b4dbfc

6 years ago[iOS] MediaDocument should set a viewport
dino@apple.com [Sun, 6 Jul 2014 00:03:15 +0000 (00:03 +0000)]
[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: https://svn.webkit.org/repository/webkit/trunk@170827 268f45cc-cd09-0410-ab3c-d52691b4dbfc

6 years agoUnreviewed, rolling out r170825.
commit-queue@webkit.org [Sat, 5 Jul 2014 17:56:58 +0000 (17:56 +0000)]
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: https://svn.webkit.org/repository/webkit/trunk@170826 268f45cc-cd09-0410-ab3c-d52691b4dbfc

6 years agoGenerate isMathMLFoo() toMathMLFoo() by using NODE_TYPE_CASTS macro and generateTypeH...
gyuyoung.kim@samsung.com [Sat, 5 Jul 2014 17:36:03 +0000 (17:36 +0000)]
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: https://svn.webkit.org/repository/webkit/trunk@170825 268f45cc-cd09-0410-ab3c-d52691b4dbfc

6 years ago[EFL] Add libgeoclue-dev to Tools/efl/install-dependencies.
commit-queue@webkit.org [Sat, 5 Jul 2014 10:29:22 +0000 (10:29 +0000)]
[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: https://svn.webkit.org/repository/webkit/trunk@170824 268f45cc-cd09-0410-ab3c-d52691b4dbfc

6 years ago[EFL] Support Geolocation
gyuyoung.kim@samsung.com [Sat, 5 Jul 2014 06:33:16 +0000 (06:33 +0000)]
[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: https://svn.webkit.org/repository/webkit/trunk@170823 268f45cc-cd09-0410-ab3c-d52691b4dbfc

6 years agoCSS JIT: compile :in-range and :out-of-range
benjamin@webkit.org [Sat, 5 Jul 2014 05:25:58 +0000 (05:25 +0000)]
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: https://svn.webkit.org/repository/webkit/trunk@170822 268f45cc-cd09-0410-ab3c-d52691b4dbfc

6 years ago[EFL][WK2] Enhance the Minibrowser to show selected/highlighted text in search bar...
commit-queue@webkit.org [Sat, 5 Jul 2014 04:28:02 +0000 (04:28 +0000)]
[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: https://svn.webkit.org/repository/webkit/trunk@170820 268f45cc-cd09-0410-ab3c-d52691b4dbfc

6 years agoFast path for jsStringWithCache() when asked for the same string repeatedly.
akling@apple.com [Sat, 5 Jul 2014 03:36:36 +0000 (03:36 +0000)]
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: https://svn.webkit.org/repository/webkit/trunk@170818 268f45cc-cd09-0410-ab3c-d52691b4dbfc

6 years agoSubpixel rendering: ebay.com rotating billboard on the main page has cut off buttons.
zalan@apple.com [Sat, 5 Jul 2014 03:03:01 +0000 (03:03 +0000)]
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: https://svn.webkit.org/repository/webkit/trunk@170817 268f45cc-cd09-0410-ab3c-d52691b4dbfc

6 years agoQualifiedName should use RefPtr<QualifiedNameImpl> internally.
akling@apple.com [Sat, 5 Jul 2014 01:29:55 +0000 (01:29 +0000)]
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: https://svn.webkit.org/repository/webkit/trunk@170816 268f45cc-cd09-0410-ab3c-d52691b4dbfc

6 years ago[iOS] [Media] Prevent page zoom if it started in the video element
dino@apple.com [Fri, 4 Jul 2014 23:03:24 +0000 (23:03 +0000)]
[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: https://svn.webkit.org/repository/webkit/trunk@170815 268f45cc-cd09-0410-ab3c-d52691b4dbfc

6 years ago[EFL][WK2]Fix build break in EFL WK2
ryuan.choi@samsung.com [Fri, 4 Jul 2014 22:27:14 +0000 (22:27 +0000)]
[EFL][WK2]Fix build break in EFL WK2
https://bugs.webkit.org/show_bug.cgi?id=134629

Unreviewed build fix.

Patch by Rohit Kumar <kumar.rohit@samsung.com> on 2014-07-04

* WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp:
(WebKit::CoordinatedDrawingArea::scheduleCompositingLayerFlushImmediately):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h:

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

6 years ago[CoordinatedGraphics] Use the C++11 syntax to clean-up for loops
commit-queue@webkit.org [Fri, 4 Jul 2014 22:26:09 +0000 (22:26 +0000)]
[CoordinatedGraphics] Use the C++11 syntax to clean-up for loops
https://bugs.webkit.org/show_bug.cgi?id=134594

Patch by Hunseop Jeong <hs85.jeong@samsung.com> on 2014-07-04
Reviewed by Darin Adler.

Convert a couple of loops to range-based for

No change in functionality, no new tests.

* platform/graphics/TiledBackingStore.cpp:
(WebCore::TiledBackingStore::updateTileBuffers):
(WebCore::TiledBackingStore::resizeEdgeTiles):
(WebCore::TiledBackingStore::setKeepRect):
* platform/graphics/texmap/coordinated/CompositingCoordinator.cpp:
(WebCore::CompositingCoordinator::~CompositingCoordinator):
(WebCore::CompositingCoordinator::flushPendingImageBackingChanges):
(WebCore::CompositingCoordinator::setVisibleContentsRect):
(WebCore::CompositingCoordinator::purgeBackingStores):
* platform/graphics/texmap/coordinated/CoordinatedBackingStore.cpp:
(WebCore::CoordinatedBackingStore::removeAllTiles):
(WebCore::CoordinatedBackingStore::paintToTextureMapper):
(WebCore::CoordinatedBackingStore::drawBorder):
(WebCore::CoordinatedBackingStore::drawRepaintCounter):
(WebCore::CoordinatedBackingStore::commitTileOperations):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp:
(WebCore::CoordinatedGraphicsScene::adjustPositionForFixedLayers):
(WebCore::CoordinatedGraphicsScene::commitPendingBackingStoreOperations):

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

6 years agoBuild fix after r170811.
mitz@apple.com [Fri, 4 Jul 2014 21:54:48 +0000 (21:54 +0000)]
Build fix after r170811.

* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController reload:]):

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

6 years ago[Cocoa] -[WKWebView _reload] is unused
mitz@apple.com [Fri, 4 Jul 2014 21:00:41 +0000 (21:00 +0000)]
[Cocoa] -[WKWebView _reload] is unused
https://bugs.webkit.org/show_bug.cgi?id=134638

Reviewed by Sam Weinig.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _reload]): Deleted.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:

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

6 years ago[WK2] Take TopContentInset into account when sending dictionary lookup point to Plugi...
timothy_horton@apple.com [Fri, 4 Jul 2014 20:49:47 +0000 (20:49 +0000)]
[WK2] Take TopContentInset into account when sending dictionary lookup point to PluginView
https://bugs.webkit.org/show_bug.cgi?id=134624
<rdar://problem/17222041>

Reviewed by Sam Weinig.

* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::performDictionaryLookupAtLocation):
Perform the same coordinate conversion we use for mouse events, which happens
to take the top content inset into account.

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

6 years agoCTTE: ScriptElement always has a HTTPScriptElement or SVGScriptElement.
akling@apple.com [Fri, 4 Jul 2014 19:54:43 +0000 (19:54 +0000)]
CTTE: ScriptElement always has a HTTPScriptElement or SVGScriptElement.
<https://webkit.org/b/134637>

Have ScriptElement store the pointer to the more specific subclass
element as a reference. Also made the constructor protected since
nobody should instantiate ScriptElement directly.

Reviewed by Antti Koivisto.

* dom/ScriptElement.cpp:
(WebCore::ScriptElement::ScriptElement):
(WebCore::ScriptElement::childrenChanged):
(WebCore::ScriptElement::dispatchErrorEvent):
(WebCore::ScriptElement::prepareScript):
(WebCore::ScriptElement::requestScript):
(WebCore::ScriptElement::executeScript):
(WebCore::ScriptElement::notifyFinished):
(WebCore::ScriptElement::ignoresLoadRequest):
(WebCore::ScriptElement::scriptContent):
* dom/ScriptElement.h:
(WebCore::ScriptElement::element):
* dom/ScriptRunner.cpp:
(WebCore::ScriptRunner::queueScriptForExecution):
* html/HTMLScriptElement.cpp:
(WebCore::HTMLScriptElement::HTMLScriptElement):
* svg/SVGScriptElement.cpp:
(WebCore::SVGScriptElement::SVGScriptElement):

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

6 years agoinput type=range element should only fire change events after committing a value
commit-queue@webkit.org [Fri, 4 Jul 2014 19:12:25 +0000 (19:12 +0000)]
input type=range element should only fire change events after committing a  value
https://bugs.webkit.org/show_bug.cgi?id=134545

Patch by Julien Quint <pom@graougraou.com> on 2014-07-04
Reviewed by Dean Jackson.

Source/WebCore:
A "change" event was fired every time the slider thumb element was dragged
by the user. The "change" event is now fired only after the thumb
element has stopped moving; previously, both "input" and "change" events
where dispatched while changes were being made. This new behavior is
consistent with the specification (cf.
http://www.whatwg.org/specs/web-apps/current-work/multipage/common-input-element-attributes.html#event-input-change),
as well as other implementations such as Firefox and Chrome.

* Modules/mediacontrols/mediaControlsApple.js:
(Controller.prototype.createControls): Listen to the "input" event
rather than the "change" event for the timeline control in order to
keep track of value changes when the user is dragging the thumb.
* accessibility/AccessibilitySlider.cpp:
(WebCore::AccessibilitySlider::setValue): Dispatch "change" event while
setting the new value rather than dispatching later, since setting the
value now clears the change flag.
* html/RangeInputType.cpp:
(WebCore::RangeInputType::setValue): Update the text value of the
control in the case when no event is to be dispatched, so that this
value can be checked the next time a "change" event dispatch is
requested.
* html/shadow/SliderThumbElement.cpp:
(WebCore::SliderThumbElement::setPositionFromPoint): Removed the
dispatch of the "change" event, and no longer track the text value of
the element as a result of dispatching a "change" event.
(WebCore::SliderThumbElement::stopDragging): Dispatch the "change" event
on completing the drag.

LayoutTests:
Two existing tests are updated to count "input" events as well as
"change" events. The tests now verify that "change" is only fired once
after every slider drag completes, whereas "input" may be fired more
than once.

* fast/forms/range/range-drag-expected.txt:
* fast/forms/range/range-drag-when-toggled-disabled-expected.txt:
* fast/forms/range/range-drag-when-toggled-disabled.html:
* fast/forms/range/range-drag.html:

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

6 years agoCTTE: ApplicationCacheHost always has a DocumentLoader.
akling@apple.com [Fri, 4 Jul 2014 18:07:26 +0000 (18:07 +0000)]
CTTE: ApplicationCacheHost always has a DocumentLoader.
<https://webkit.org/b/b/128435>

Have ApplicationCacheHost store the backpointer to its owning
DocumentLoader as a reference.

Reviewed by Sam Weinig.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::DocumentLoader):
(WebCore::DocumentLoader::startLoadingMainResource):
* loader/appcache/ApplicationCacheHost.cpp:
(WebCore::ApplicationCacheHost::ApplicationCacheHost):
(WebCore::ApplicationCacheHost::~ApplicationCacheHost):
(WebCore::ApplicationCacheHost::selectCacheWithoutManifest):
(WebCore::ApplicationCacheHost::selectCacheWithManifest):
(WebCore::ApplicationCacheHost::maybeLoadMainResource):
(WebCore::ApplicationCacheHost::maybeLoadFallbackForMainResponse):
(WebCore::ApplicationCacheHost::maybeLoadFallbackForMainError):
(WebCore::ApplicationCacheHost::failedLoadingMainResource):
(WebCore::ApplicationCacheHost::finishedLoadingMainResource):
(WebCore::ApplicationCacheHost::maybeLoadResource):
(WebCore::ApplicationCacheHost::maybeLoadFallbackForError):
(WebCore::ApplicationCacheHost::maybeLoadSynchronously):
(WebCore::ApplicationCacheHost::notifyDOMApplicationCache):
(WebCore::ApplicationCacheHost::stopDeferringEvents):
(WebCore::ApplicationCacheHost::scheduleLoadFallbackResourceFromApplicationCache):
(WebCore::ApplicationCacheHost::update):
(WebCore::ApplicationCacheHost::swapCache):
(WebCore::ApplicationCacheHost::abort):
(WebCore::ApplicationCacheHost::isApplicationCacheEnabled):
* loader/appcache/ApplicationCacheHost.h:
(WebCore::ApplicationCacheHost::documentLoader): Deleted.

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

6 years agobuildAccessibilityTree() needs to be removed from individual layout tests
mario.prada@samsung.com [Fri, 4 Jul 2014 15:31:57 +0000 (15:31 +0000)]
buildAccessibilityTree() needs to be removed from individual layout tests
https://bugs.webkit.org/show_bug.cgi?id=95286

Reviewed by Chris Fleizach.

Extracted two functions to 'dump' and 'touch' the accessibility
hierarchies out of different layout tests and into a single file,
living in LayoutTests/resources/accessibility-helper.js

* resources/accessibility-helper.js: Added.
(dumpAccessibilityTree): New, based on buildAccessibilityTree()
for the cases where it was used to actually 'dump' it into the output.
(touchAccessibilityTree): Same, but for the cases where we don't
want to dump the accessibility tree, just to make sure is generated.

Updated affected layout tests to use the newly added helper functions.

* accessibility/adjacent-continuations-cause-assertion-failure.html: Updated.
* accessibility/children-changed-sends-notification.html: Ditto.
* accessibility/deleting-iframe-destroys-axcache.html: Ditto.
* accessibility/div-within-anchors-causes-crash.html: Ditto.
* accessibility/first-letter-text-transform-causes-crash.html: Ditto.
* accessibility/image-map-update-parent-crash.html: Ditto.
* accessibility/table-with-empty-thead-causes-crash.html: Ditto.
* platform/efl/accessibility/media-emits-object-replacement.html: Ditto.
* platform/gtk/accessibility/entry-and-password.html: Ditto.
* platform/gtk/accessibility/media-emits-object-replacement.html: Ditto.
* platform/gtk/accessibility/replaced-objects-in-anonymous-blocks.html: Ditto.

Updated Mac specific expectations not to print the "End of test" element.

* platform/mac-wk2/accessibility/deleting-iframe-destroys-axcache-expected.txt: Updated.
* platform/mac/accessibility/adjacent-continuations-cause-assertion-failure-expected.txt: Ditto.
* platform/mac/accessibility/deleting-iframe-destroys-axcache-expected.txt: Ditto.
* platform/mac/accessibility/div-within-anchors-causes-crash-expected.txt: Ditto.

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

6 years agoREGRESSION(r159345): Lines are clipped between pages when printing web content from...
antti@apple.com [Fri, 4 Jul 2014 13:55:55 +0000 (13:55 +0000)]
REGRESSION(r159345): Lines are clipped between pages when printing web content from Safari
https://bugs.webkit.org/show_bug.cgi?id=134633

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

Reviewed by Zalan Bujtas.

Test: printing/simple-lines-break.html

* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseFor):

    Disable simple lines if global pagination is enabled.
    Printing does not currently use flow threads which we already test for.

LayoutTests:

Reviewed by Zalan Bujtas.

* printing/simple-lines-break-expected.html: Added.
* printing/simple-lines-break.html: Added.

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

6 years agoTypo in watchlist config means four specific people get Cc'd on everything
timothy_horton@apple.com [Fri, 4 Jul 2014 10:33:24 +0000 (10:33 +0000)]
Typo in watchlist config means four specific people get Cc'd on everything
https://bugs.webkit.org/show_bug.cgi?id=134626

Reviewed by Gyuyoung Kim.

* Scripts/webkitpy/common/config/watchlist:
Remove leading pipe, which meant that this rule matched everything!

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

6 years ago2014-07-04 Philippe Normand <pnormand@igalia.com>
philn@webkit.org [Fri, 4 Jul 2014 09:58:22 +0000 (09:58 +0000)]
2014-07-04  Philippe Normand  <pnormand@igalia.com>

        Unreviewed, GTK WK2 build fix after r170787.

        * WebProcess/WebPage/DrawingAreaImpl.cpp:
        (WebKit::DrawingAreaImpl::scheduleCompositingLayerFlushImmediately):
        * WebProcess/WebPage/DrawingAreaImpl.h:

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

6 years agoSource/WebCore: Unreviewed. Fixing the build after r170795.
zandobersek@gmail.com [Fri, 4 Jul 2014 08:50:56 +0000 (08:50 +0000)]
Source/WebCore: Unreviewed. Fixing the build after r170795.

Mac didn't like that change as it seems to properly typedef long long to int64_t.
That's not the case on 64-bit Linux (for some reason), so I'm changing the type of
the two long long variables in FormDataElement to int64_t to avoid any further trouble.

* platform/network/FormData.h:

Source/WebKit2: Unreviewed. Reverting the bad changes introduced in r170795.

* Platform/IPC/ArgumentDecoder.cpp:
(IPC::ArgumentDecoder::decode): Deleted.
* Platform/IPC/ArgumentDecoder.h:
* Platform/IPC/ArgumentEncoder.cpp:
(IPC::ArgumentEncoder::encode): Deleted.
* Platform/IPC/ArgumentEncoder.h:

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

6 years agoUnreviewed. Fixing the build for ports on 64-bit Linux.
zandobersek@gmail.com [Fri, 4 Jul 2014 08:23:44 +0000 (08:23 +0000)]
Unreviewed. Fixing the build for ports on 64-bit Linux.

Add IPC encoding and decoding overloads for the long long type, needed
after r170755 started encoding and decoding long long variables in
FormDataElement.

* Platform/IPC/ArgumentDecoder.cpp:
(IPC::ArgumentDecoder::decode):
* Platform/IPC/ArgumentDecoder.h:
* Platform/IPC/ArgumentEncoder.cpp:
(IPC::ArgumentEncoder::encode):
* Platform/IPC/ArgumentEncoder.h:

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

6 years ago[iOS][WK2] Black web view after un-suspending process
timothy_horton@apple.com [Fri, 4 Jul 2014 07:10:10 +0000 (07:10 +0000)]
[iOS][WK2] Black web view after un-suspending process
https://bugs.webkit.org/show_bug.cgi?id=134623
<rdar://problem/17513223>

Reviewed by Simon Fraser.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::viewStateDidChange):
Add an argument to viewStateDidChange that allows callers (-[WKContentView _applicationWillEnterForeground:])
to force us to wait for a synchronous reply from the Web process after performing a view state change.

(WebKit::WebPageProxy::dispatchViewStateChange):
Move the has-been-in-window-and-now-is-newly-in-window check into dispatchViewStateChange.
Adjust the logic surrounding going into/out of window by factoring out the IsInWindow-did-change check, for clarity.

* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _applicationWillEnterForeground:]):
As previously mentioned, wait for a reply when foregrounding.

* WebProcess/WebPage/DrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlushImmediately):
(WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlush):
(WebKit::RemoteLayerTreeDrawingArea::viewStateDidChange):
Make sure to schedule a commit immediately if the UI process is waiting for a reply.
Previously we assumed that a commit would be scheduled anyway because we would have to reparent the
layer tree, but that doesn't happen in the suspension-without-unparenting case. Also, we want to skip
all throttling in this case.

* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::scheduleCompositingLayerFlushImmediately):

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

6 years ago[EFL][WK2] Enhance the Minibrowser to show text search count and close search bar.
commit-queue@webkit.org [Fri, 4 Jul 2014 05:38:20 +0000 (05:38 +0000)]
[EFL][WK2] Enhance the Minibrowser to show text search count and close search bar.
https://bugs.webkit.org/show_bug.cgi?id=134486

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

Use on_search_close_button_clicked() callback to close search bar and on_search_text_found() callback to show search count.

* MiniBrowser/efl/main.c:
(search_box_show):
(search_box_hide):
(on_search_close_button_clicked):
(on_search_text_found):
(window_create):

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

6 years agoShould not take background task assertion for NetworkProcess
barraclough@apple.com [Fri, 4 Jul 2014 01:12:45 +0000 (01:12 +0000)]
Should not take background task assertion for NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=134622

Reviewed by Tim Horton.

When the WebContent wants to complete a task in the background we take a process assertion on the child process, and also need to prevent the UI process from suspending.
However for the NetworkProcess we always just hold a process assertion, and don't want this to interfere with UIApp suspension.

* Platform/IPC/mac/ConnectionMac.mm:
(IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog):
    - ProcessAssertion -> ProcessAndUIAssertion
* UIProcess/ProcessAssertion.cpp:
(WebKit::ProcessAssertion::ProcessAssertion):
    - assignment -> initializer list.
(WebKit::ProcessAndUIAssertion::ProcessAndUIAssertion):
(WebKit::ProcessAndUIAssertion::~ProcessAndUIAssertion):
(WebKit::ProcessAndUIAssertion::setState):
    - added no-op implementation.
(WebKit::ProcessAssertion::~ProcessAssertion): Deleted.
* UIProcess/ProcessAssertion.h:
    - removed ~ProcessAssertion, added ProcessAndUIAssertion class.
* UIProcess/ProcessThrottler.cpp:
(WebKit::ProcessThrottler::didConnnectToProcess):
    - ProcessAssertion -> ProcessAndUIAssertion
* UIProcess/ProcessThrottler.h:
    - ProcessAssertion -> ProcessAndUIAssertion
* UIProcess/ios/ProcessAssertionIOS.mm:
(WebKit::ProcessAssertion::ProcessAssertion):
    - assignment -> initializer list.
    - moved code to manage WKProcessAssertionBackgroundTaskManager
(WebKit::ProcessAssertion::setState):
    - moved code to manage WKProcessAssertionBackgroundTaskManager
(WebKit::ProcessAndUIAssertion::ProcessAndUIAssertion):
(WebKit::ProcessAndUIAssertion::~ProcessAndUIAssertion):
(WebKit::ProcessAndUIAssertion::setState):
    - moved code to manage WKProcessAssertionBackgroundTaskManager from ProcessAssertion.
(WebKit::ProcessAssertion::~ProcessAssertion): Deleted.
    - delete - moved code to manage WKProcessAssertionBackgroundTaskManager

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

6 years agoClean up Brady's mess on iOS.
simon.fraser@apple.com [Fri, 4 Jul 2014 01:09:35 +0000 (01:09 +0000)]
Clean up Brady's mess on iOS.

* Platform/mac/StringUtilities.h:
* Platform/mac/StringUtilities.mm:

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

6 years ago[iOS WK2] Compositing layers draw outside page bounds
simon.fraser@apple.com [Fri, 4 Jul 2014 00:48:14 +0000 (00:48 +0000)]
[iOS WK2] Compositing layers draw outside page bounds
https://bugs.webkit.org/show_bug.cgi?id=134619
<rdar://problem/16953222>

Reviewed by Benjamin Poulain.

With the new rubber-banding behavior, we no longer have the root content layer clipping all
the web layers, but this resulted in web layers which were moved outside the viewport by CSS
transforms not being clipped.

Fix by adding a clipping layer inside the scroll view, above _rootContentView. This layer
normally has the same bounds as the content, but when rubber-banding or pinching,
it takes the union of the content bounds and the rect used for fixed positioning.
To make scrolling work as expected in this scenario, when it has non-zero offset, it
has to compensate by setting its bounds origin.

The bounds of the clipping layer are updated on scrolling/zooming, and when the
layer commit tells us that the content size changed.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _updateScrollViewBackground]):
* UIProcess/ios/WKContentView.mm:
(-[WKContentView initWithFrame:context:configuration:webView:]):
(-[WKContentView updateFixedClippingView:]):
(-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]):
(-[WKContentView _didCommitLayerTree:]):

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

6 years agoWhen showing the selection menu, include menu options for all selected phone numbers.
beidson@apple.com [Fri, 4 Jul 2014 00:39:41 +0000 (00:39 +0000)]
When showing the selection menu, include menu options for all selected phone numbers.
<rdar://problem/16983434>, <rdar://problem/16874568>, and https://bugs.webkit.org/show_bug.cgi?id=134613

Reviewed by Tim Horton.

Source/WebCore:
* English.lproj/Localizable.strings:

* dom/Range.cpp:
(WebCore::rangesOverlap): Fix reversed arguments that caused some types of overlaps to not be detected.

Source/WebKit2:
Move some telephone number menu logic from WebKitSystemInterface here.
Also provide utility to get just the one menu item relevant to a telephone number.
* Platform/mac/MenuUtilities.h:
* Platform/mac/MenuUtilities.mm: Added.
(WebKit::menuItemForTelephoneNumber):
(WebKit::menuItemsForTelephoneNumber):

* Platform/mac/StringUtilities.h:
* Platform/mac/StringUtilities.mm:
(WebKit::formattedPhoneNumberString): Return a localized formatted phone number.

Add a member to track the selected phone numbers:
* Shared/ContextMenuContextData.h:
(WebKit::ContextMenuContextData::ContextMenuContextData):
(WebKit::ContextMenuContextData::selectedTelephoneNumbers):

* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:

* UIProcess/mac/WebContextMenuProxyMac.mm:
(WebKit::WebContextMenuProxyMac::setupServicesMenu): Also add menu items for each phone number that is
  in the selection.

Switch away from a WKSI method, and remove a lot of unneeded forward declarations and soft linking:
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::showTelephoneNumberMenu):
(WebKit::WebPageProxy::showSelectionServiceMenu):

* WebKit2.xcodeproj/project.pbxproj:

* WebProcess/WebPage/mac/ServicesOverlayController.mm:
(WebKit::ServicesOverlayController::drawSelectionHighlight):
(WebKit::ServicesOverlayController::handleClick): Pass the phone numbers along.

* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::handleSelectionServiceClick): Pass the phone numbers along.

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

6 years agoWKProcessAssertionBackgroundTaskManager should clear member if task expires
barraclough@apple.com [Fri, 4 Jul 2014 00:36:07 +0000 (00:36 +0000)]
WKProcessAssertionBackgroundTaskManager should clear member if task expires
https://bugs.webkit.org/show_bug.cgi?id=134618

Reviewed by Anders Carlson.

Failure to do so results in a warning, and could result in us erroneously completing a background task too soon.

* UIProcess/ios/ProcessAssertionIOS.mm:
(-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):
    - remove local variable, _backgroundTask = UIBackgroundTaskInvalid;

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

6 years agoUnreviewed iOS build fix for r170774.
joepeck@webkit.org [Fri, 4 Jul 2014 00:15:19 +0000 (00:15 +0000)]
Unreviewed iOS build fix for r170774.

Remove some unnecessary WTF::moves on iOS:
error: static_assert failed "T is not an lvalue reference; move() is unnecessary."

* WebProcess/WebPage/EventDispatcher.cpp:
(WebKit::EventDispatcher::getQueuedTouchEventsForPage):
(WebKit::EventDispatcher::touchEvent):

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

6 years agoTry to fix the iOS build.
andersca@apple.com [Fri, 4 Jul 2014 00:08:36 +0000 (00:08 +0000)]
Try to fix the iOS build.

Add WebPageProxyCocoa.mm for code shared between iOS and OS X. Put the recent searches save/restore code there.

* UIProcess/Cocoa/WebPageProxyCocoa.mm: Added.
(WebKit::autosaveKey):
(WebKit::WebPageProxy::saveRecentSearches):
(WebKit::WebPageProxy::loadRecentSearches):
* UIProcess/mac/WebPageProxyMac.mm:
* WebKit2.xcodeproj/project.pbxproj:

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

6 years agoUnreivewed, fix build break on EFL and GTK since r170767.
gyuyoung.kim@samsung.com [Thu, 3 Jul 2014 23:47:59 +0000 (23:47 +0000)]
Unreivewed, fix build break on EFL and GTK since r170767.

* wtf/CMakeLists.txt: Exclude Decoder.h and Encoder.h because those files were removed.

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

6 years agoVersioning.
lforschler@apple.com [Thu, 3 Jul 2014 23:46:34 +0000 (23:46 +0000)]
Versioning.

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

6 years ago<rdar://problem/16337741> The UI process needs to track the number of HTTP subresourc...
mitz@apple.com [Thu, 3 Jul 2014 23:31:15 +0000 (23:31 +0000)]
<rdar://problem/16337741> The UI process needs to track the number of HTTP subresource loads in progress (or at least whether there are any)
https://bugs.webkit.org/show_bug.cgi?id=134615

Reviewed by Anders Carlsson.

Added a _networkRequestsInProgress boolean property to WKWebView.

* UIProcess/API/Cocoa/WKBrowsingContextController.mm: Added no-op overrides of new
PageLoadStateObserver member functions.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _networkRequestsInProgress]): New getter that gets this state from the
PageLoadState.
* UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared new property.

* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::willChangeNetworkRequestsInProgress):: Override this new
PageLoadState::Observer member function by sending the appropriate KVO change message to the
WKWebView.
(WebKit::NavigationState::didChangeNetworkRequestsInProgress): Ditto.

* UIProcess/PageLoadState.cpp:
(WebKit::PageLoadState::commitChanges): Check for changes to networkRequestsInProgress
and call the observers if needed.
(WebKit::PageLoadState::reset): Reset networkRequestsInProgress in the uncommitted state.
(WebKit::PageLoadState::setNetworkRequestsInProgress): Set networkRequestsInProgress in the
uncommitted state.
* UIProcess/PageLoadState.h:
(WebKit::PageLoadState::networkRequestsInProgress): Added this getter.
(WebKit::PageLoadState::Data::Data): Initialize new networkRequestsInProgress member.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setNetworkRequestsInProgress): Added. Updates the PageLoadState.
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in: Added SetNetworkRequestsInProgress message.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::assignIdentifierToInitialRequest): Call
WebPage::addResourceRequest.
(WebKit::WebFrameLoaderClient::dispatchDidFinishLoading): Call
WebPage::removeResourceRequest.
(WebKit::WebFrameLoaderClient::dispatchDidFailLoading): Ditto.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::addResourceRequest): Added. If the new request is for an HTTP-family URL,
add its identifier to the set of network resourece request identifiers. If the set was
previously empty, send the WebPageProxy a message.
(WebKit::WebPage::removeResourceRequest): Added. Remove the identifier from the set. If it
becomes empty, send the WebPageProxy a message.
* WebProcess/WebPage/WebPage.h:

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

6 years agoRemove two unused functions
andersca@apple.com [Thu, 3 Jul 2014 22:31:26 +0000 (22:31 +0000)]
Remove two unused functions
https://bugs.webkit.org/show_bug.cgi?id=134614

Reviewed by Andreas Kling.

* UIProcess/LegacySessionStateCoding.h:
* UIProcess/mac/LegacySessionStateCoding.cpp:
(WebKit::encodeLegacySessionHistoryEntryData): Deleted.
(WebKit::decodeLegacySessionHistoryEntryData): Deleted.

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

6 years agoAdd WTF::move()
dbates@webkit.org [Thu, 3 Jul 2014 22:13:54 +0000 (22:13 +0000)]
Add WTF::move()
https://bugs.webkit.org/show_bug.cgi?id=134500

Source/JavaScriptCore:
Rubber-stamped by Anders Carlsson.

Substitute WTF::move() for std::move().

* bytecode/CodeBlock.h:
* bytecode/UnlinkedCodeBlock.cpp:
* bytecompiler/BytecodeGenerator.cpp:
* dfg/DFGGraph.cpp:
* dfg/DFGJITCompiler.cpp:
* dfg/DFGStackLayoutPhase.cpp:
* dfg/DFGWorklist.cpp:
* heap/DelayedReleaseScope.h:
* heap/HeapInlines.h:
[...]

Source/WebCore:
Rubber-stamped by Anders Carlsson.

Substitute WTF::move() for std::move().

* Modules/battery/NavigatorBattery.cpp:
* Modules/encryptedmedia/MediaKeys.cpp:
* Modules/gamepad/NavigatorGamepad.cpp:
* Modules/gamepad/deprecated/NavigatorGamepad.cpp:
* Modules/geolocation/NavigatorGeolocation.cpp:
* Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
* Modules/indexeddb/IDBDatabaseBackend.cpp:
* Modules/indexeddb/IDBDatabaseBackend.h:
[...]

Source/WebKit/ios:
Rubber-stamped by Anders Carlsson.

Substitute WTF::move() for std::move().

* WebCoreSupport/WebFixedPositionContent.mm:
(-[WebFixedPositionContent setViewportConstrainedLayers:stickyContainerMap:]):
* WebCoreSupport/WebInspectorClientIOS.mm:
(WebInspectorFrontendClient::WebInspectorFrontendClient):

Source/WebKit/mac:
Rubber-stamped by Anders Carlsson.

Substitute WTF::move() for std::move().

* History/WebHistoryItem.mm:
(-[WebHistoryItem initFromDictionaryRepresentation:]):
* Plugins/Hosted/NetscapePluginInstanceProxy.h:
(WebKit::NetscapePluginInstanceProxy::setCurrentReply):
* Plugins/WebNetscapePluginView.mm:
(-[WebNetscapePluginView scheduleTimerWithInterval:repeat:timerFunc:]):
* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::dispatchDecidePolicyForResponse):
(WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
(WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
(WebFrameLoaderClient::dispatchWillSubmitForm):
* WebCoreSupport/WebInspectorClient.mm:
(WebInspectorClient::openInspectorFrontend):
(WebInspectorFrontendClient::WebInspectorFrontendClient):
* WebView/WebArchive.mm:
(-[WebArchive initWithMainResource:subresources:subframeArchives:]):

Source/WebKit/win:
Rubber-stamped by Anders Carlsson.

Substitute WTF::move() for std::move().

* WebCoreSupport/WebInspectorClient.cpp:
(WebInspectorClient::openInspectorFrontend):
(WebInspectorFrontendClient::WebInspectorFrontendClient):
* WebHistory.cpp:
(createUserInfoFromArray):
* WebHistoryItem.cpp:
(WebHistoryItem::initFromDictionaryRepresentation):
* WebView.cpp:
(WebView::addToDirtyRegion):
(WebView::scrollBackingStore):

Source/WebKit2:
Rubber-stamped by Anders Carlsson.

Substitute WTF::move() for std::move().

* DatabaseProcess/DatabaseProcess.cpp:
* DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
* NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm:
* NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
* Platform/IPC/ArgumentCoders.h:
* Platform/IPC/ArgumentDecoder.cpp:
* Platform/IPC/Connection.cpp:
* Platform/IPC/Connection.h:
[...]

Source/WTF:
Reviewed by Darin Adler.

Substitution of WTF::move() for std::move() rubber-stamped by Anders Carlsson.

Implement WTF::move(), a replacement for std::move(). WTF::move() is less error
prone than std::move() as it compile asserts that its argument is a non-const
lvalue reference before ultimately casting it to a rvalue reference (via std::move).

* wtf/Deque.h: Substitute WTF::move() for std::move().
* wtf/HashMap.h: Ditto.
* wtf/HashSet.h: Ditto.
* wtf/HashTable.h: Ditto.
* wtf/IteratorAdaptors.h: Ditto.
* wtf/IteratorRange.h: Ditto.
* wtf/ListHashSet.h: Ditto.
* wtf/MainThread.cpp: Ditto.
[...]
* wtf/StdLibExtras.h:
(WTF::move): Added.
[...]

Tools:
Rubber-stamped by Anders Carlsson.

Substitute WTF::move() for std::move().

* DumpRenderTree/win/DRTDataObject.cpp:
* TestWebKitAPI/Tests/WTF/HashMap.cpp:
* TestWebKitAPI/Tests/WTF/HashSet.cpp:
* TestWebKitAPI/Tests/WTF/RefPtr.cpp:
* TestWebKitAPI/Tests/WTF/Vector.cpp:
* TestWebKitAPI/Tests/WTF/WTFString.cpp:
* TestWebKitAPI/Tests/WTF/ns/RetainPtr.mm: Added FIXME comments that explain that some of the sub-tests
aren't actually testing move semantics in tests: MoveAssignmentFromSameType, MoveAssignmentFromSimilarType,
ConstructionFromSameType, and ConstructionFromSimilarType.
* TestWebKitAPI/Tests/WebCore/CalculationValue.cpp:

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

6 years ago[iOS][WK2] Fix small bugs of dynamicViewportSizeUpdate that were causing inaccuracies...
benjamin@webkit.org [Thu, 3 Jul 2014 22:11:30 +0000 (22:11 +0000)]
[iOS][WK2] Fix small bugs of dynamicViewportSizeUpdate that were causing inaccuracies in the computed target
https://bugs.webkit.org/show_bug.cgi?id=134582

Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-07-03
Reviewed by Tim Horton.

Source/WebCore:
* WebCore.exp.in:
* platform/ScrollView.h:
(WebCore::ScrollView::unobscuredContentSize):
* platform/ios/ScrollViewIOS.mm:
(WebCore::ScrollView::unobscuredContentRect):
(WebCore::ScrollView::setUnobscuredContentSize):

Source/WebKit2:
This patch fixes two small bugs that were causing "jumpiness" on animated resize:
1) The new scale was less accurate than the target scale, making the WebProcess force a worse scale on the content.
2) The code putting back the rects in view was ignoring the obscured insets, constraining the scroll position more
   than it should be.

The first problem was cause by a series of rounding issues accumulating to the fact that "scale != targetScale"
was almost never true.

The first issue is that the unobscured content size was stored in integer coordinates. Because of that, it was
impossible to determine accurately how much content is in the view.
The outcome was that visibleHorizontalFraction was very inaccurate compared to what the UIProcess computed.

Another issue affecting the scale is that scaleAfterViewportWidthChange was computing the widthToKeepInView
on floating point. Since ARM64 does all those computations on doubles in the UIProcess, the value would be quite
different from the received targetScale.

Finally, the code uses withinEpsilon() instead of a strict equality to reduce the effect of rounding errors.

For the second issue, the problem was that I was bounding the exposed rect to the page bounds. It is completely
valid to have an exposed rect outside the page bounds, that area is just under the obscured insets.

On the other hand, the unobscured rect needs to be within the bounds as we do not want to rotate to a rubberbanding
position. The fix is simply to put the right rect into bounds, and the horizontal/vertical adjustement applies on
both rects.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::scaleAfterViewportWidthChange):
(WebKit::WebPage::dynamicViewportSizeUpdate):
(WebKit::WebPage::updateVisibleContentRects):

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

6 years agoFix build.
andersca@apple.com [Thu, 3 Jul 2014 21:52:32 +0000 (21:52 +0000)]
Fix build.

* UIProcess/mac/WebPageProxyMac.mm:

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

6 years agoSSA DCE should process blocks in forward order
fpizlo@apple.com [Thu, 3 Jul 2014 21:04:07 +0000 (21:04 +0000)]
SSA DCE should process blocks in forward order
https://bugs.webkit.org/show_bug.cgi?id=134611

Reviewed by Andreas Kling.

* dfg/DFGDCEPhase.cpp:
(JSC::DFG::DCEPhase::run):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::addExitArgumentForNode):
* tests/stress/dead-value-with-mov-hint-in-another-block.js: Added.
(foo):

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

6 years agoGet rid of WebPageProxyCF.cpp
andersca@apple.com [Thu, 3 Jul 2014 21:04:06 +0000 (21:04 +0000)]
Get rid of WebPageProxyCF.cpp
https://bugs.webkit.org/show_bug.cgi?id=134609

Reviewed by Dan Bernstein.

* UIProcess/cf/WebPageProxyCF.cpp: Removed.
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::autosaveKey):
(WebKit::WebPageProxy::saveRecentSearches):
(WebKit::WebPageProxy::loadRecentSearches):
* WebKit2.xcodeproj/project.pbxproj:

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

6 years agoGet rid of Encoder.h and Decoder.h from WTF
andersca@apple.com [Thu, 3 Jul 2014 20:46:30 +0000 (20:46 +0000)]
Get rid of Encoder.h and Decoder.h from WTF
https://bugs.webkit.org/show_bug.cgi?id=134600

Reviewed by Darin Adler.

* WTF.vcxproj/WTF.vcxproj:
* WTF.vcxproj/WTF.vcxproj.filters:
* WTF.xcodeproj/project.pbxproj:
* wtf/Decoder.h: Removed.
* wtf/Encoder.h: Removed.

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

6 years agoJSActivation::symbolTablePut() should invalidate variable watchpoints
fpizlo@apple.com [Thu, 3 Jul 2014 20:22:23 +0000 (20:22 +0000)]
JSActivation::symbolTablePut() should invalidate variable watchpoints
https://bugs.webkit.org/show_bug.cgi?id=134602

Reviewed by Oliver Hunt.

Usually stores to captured variables cause us to invalidate the variable watchpoint because CodeBlock does so
during linking - we essentially assume that if it's at all possible for an inner function to store to a
variable we declare then this variable cannot be a constant. But this misses the dynamic store case, i.e.
JSActivation::symbolTablePut(). Part of the problem here is that JSActivation duplicates
JSSymbolTableObject's symbolTablePut() logic, which did have the invalidation. This patch keeps that code
duplicated, but fixes JSActivation::symbolTablePut() to do the right thing.

* runtime/JSActivation.cpp:
(JSC::JSActivation::symbolTablePut):
* runtime/JSSymbolTableObject.h:
(JSC::symbolTablePut):
* tests/stress/constant-closure-var-with-dynamic-invalidation.js: Added.
(.):

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

6 years ago[Mac] WebKit1 WebView iframe not responding to scroll gestures
bfulgham@apple.com [Thu, 3 Jul 2014 20:10:33 +0000 (20:10 +0000)]
[Mac] WebKit1 WebView iframe not responding to scroll gestures
https://bugs.webkit.org/show_bug.cgi?id=134569
<rdar://problem/17309008>

Reviewed by Simon Fraser.

Source/WebCore:
New test: platform/mac/fast/scrolling/scroll-iframe-fragment.html

WK1 scrollable areas are implemented on top of PlatformWidget (i.e., NSView) objects. They only
perform a scroll operation if the EventHandler::handleWheelEvent method returns 'false', indicating
that the Cocoa layer should do scrolling work. This is in contrast to WK2, where the scrolling is
handled separately and we return 'true' from EventHandler::handleWheelEvent to indicate that the
scroll event has been handled and that no other work is needed. This mismatch in the meaning of
EventHandler::handleWheelEvent means that WK1 views do not properly handle scroll wheel events.

To correct this, we need to see if we are acting on an Element backed by a PlatformWidget. When we
are (the WK1 case) we want to return 'false' to instruct the Cocoa object to do the scroll operation.
To implement proper latching behavior in WK1, we must return 'true' in the case where we are latched
to a PlatformWidget, and that PlatformWidget did not start the scroll gesture at the edge of
the region in the dominant scroll direction.

Finally, additional logic was needed to determine whether the PlatformWidget is scrolled to the
edge in the dominant scroll direction.

* page/EventHandler.cpp:
(WebCore::EventHandler::platformCompleteWheelEvent): Added stub.
(WebCore::EventHandler::platformCompletePlatformWidgetWheelEvent): Added stub.
(WebCore::EventHandler::handleWheelEvent): Call new platformCompletePlatformWidgetWheelEvent if the
event was handled for a PlatformWidget.
* page/EventHandler.h:
* page/mac/EventHandlerMac.mm:
(WebCore::widgetForEventTarget): Added helper function.
(WebCore::scrollViewForEventTarget): Added helper function.
(WebCore::eventTargetIsPlatformWidget): Added helper function.
(WebCore::EventHandler::platformPrepareForWheelEvents): Check whether we are at a scrolled edge
for the NSView (PlatformWidget) case.
(WebCore::EventHandler::platformCompleteWheelEvent): Return 'false' when handling WK1-style scrolls.
(WebCore::EventHandler::platformCompletePlatformWidgetWheelEvent): Added. We generally want to
return false so the PlatformWidget handles scrolling, except in the case where we are latched to
a PlatformWidget, which has already performed its scroll, and we want to avoid propegating a
scroll event to an enclosing region.

LayoutTests:
* platform/mac/fast/scrolling/scroll-iframe-fragment-expected.txt: Added.
* platform/mac/fast/scrolling/scroll-iframe-fragment.html: Added.

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

6 years agoBroken build with build-webkit --no-video
ryuan.choi@samsung.com [Thu, 3 Jul 2014 20:06:42 +0000 (20:06 +0000)]
Broken build with build-webkit --no-video
https://bugs.webkit.org/show_bug.cgi?id=134587

Reviewed by Darin Adler.

MEDIA_CONTROLS_SCRIPT requires VIDEO enabled.

.:
* Source/cmake/WebKitFeatures.cmake: Added the dependency for ENABLE_MEDIA_CONTROLS_SCRIPT.

Source/WTF:
* wtf/FeatureDefines.h: Added error message for dependency failure.

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

6 years ago[WK2] Revise the flat find indicator secondary highlight shadows
timothy_horton@apple.com [Thu, 3 Jul 2014 20:01:28 +0000 (20:01 +0000)]
[WK2] Revise the flat find indicator secondary highlight shadows
https://bugs.webkit.org/show_bug.cgi?id=134607
<rdar://problem/17554828>

Reviewed by Brady Eidson.

* WebProcess/WebPage/FindController.cpp:
(WebKit::FindController::drawRect):
Bring back the secondary highlight shadow, with new constants.

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

6 years agoPreserve old behavior of creating an NSURLRequest of the exact same type as passed...
psolanki@apple.com [Thu, 3 Jul 2014 19:48:21 +0000 (19:48 +0000)]
Preserve old behavior of creating an NSURLRequest of the exact same type as passed to us
https://bugs.webkit.org/show_bug.cgi?id=134605
<rdar://problem/17544641>

Reviewed by Andreas Kling.

We have client code that passes us a subclass of NSURLRequest to load resource. Later when
we call willSendRequest, they test to make sure they get an object of the same type. My
optimization in r170642 broke this path when I cleared out the NSURLRequest object. We
already had code in updateNSURLRequest() that was taking this quirk into account but I broke
that. Fix it by reverting to old behavior for such clients.

No new tests though we need one. I will add it later.

* platform/network/cf/ResourceRequest.h:
* platform/network/cf/ResourceRequestCFNet.cpp:
(WebCore::ResourceRequest::doUpdatePlatformRequest):
(WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
(WebCore::ResourceRequest::setStorageSession):
* platform/network/ios/ResourceRequestIOS.mm:
(WebCore::ResourceRequest::updateNSURLRequest):
(WebCore::ResourceRequest::clearOrUpdateNSURLRequest):

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

6 years ago[iOS][WK2] Sometimes the swipe snapshot stays up too long
timothy_horton@apple.com [Thu, 3 Jul 2014 19:30:28 +0000 (19:30 +0000)]
[iOS][WK2] Sometimes the swipe snapshot stays up too long
https://bugs.webkit.org/show_bug.cgi?id=134506
<rdar://problem/17496803>

Reviewed by Simon Fraser.

Implement a transaction callback mechanism.
The UI process can register a callback at any point, generally immediately after sending a message to the Web process.
It will then send another message (in-order) with the callback ID to the Web process, which will put it into the next transaction
(scheduling a new one if needed). When the transaction comes back to the UI process, the callbacks are performed.
This ensures that the callback fires alongside a commit that includes the results of whatever messages were sent before it was registered.
For now, all callbacks are fired just before committing layer changes, but it's possible future patches will want post-commit callbacks.

Make use of this to remove the ViewGestureControllerIOS snapshots at the right time.

* Shared/mac/RemoteLayerTreeTransaction.h:
(WebKit::RemoteLayerTreeTransaction::callbackIDs):
(WebKit::RemoteLayerTreeTransaction::setCallbackIDs):
* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::encode):
(WebKit::RemoteLayerTreeTransaction::decode):
Add a vector of callback IDs to the transaction; encode and decode as appropriate.

* UIProcess/DrawingAreaProxy.h:
(WebKit::DrawingAreaProxy::dispatchAfterEnsuringDrawing):
(WebKit::DrawingAreaProxy::lastVisibleTransactionID): Deleted.
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::~RemoteLayerTreeDrawingAreaProxy):
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
(WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing):
Add dispatchAfterEnsuringDrawing, which takes a function.
When a callback is added, we send the callback ID to the Web process via the AddTransactionCallbackID message.
Perform callbacks listed in the incoming transaction's vector of callback IDs.

* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::addTransactionCallbackID):
* WebProcess/WebPage/DrawingArea.messages.in:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
(WebKit::RemoteLayerTreeDrawingArea::addTransactionCallbackID):
Keep track of the pending callback IDs on the drawing area, and move them into the transaction.
We schedule a flush when installing a transaction callback on the premise that
sometimes the action (goToBackForwardListItem in the swipe case) might have already occurred
and been committed by the time the Web process receives AddTransactionCallbackID, so we need
to cause another commit to send the callbacks across. If said commit is still pending, this is a no-op.

* UIProcess/ios/ViewGestureControllerIOS.mm:
(allViewGestureControllers):
(WebKit::ViewGestureController::ViewGestureController):
(WebKit::ViewGestureController::~ViewGestureController):
(WebKit::ViewGestureController::endSwipeGesture):
(WebKit::ViewGestureController::willCommitPostSwipeTransitionLayerTree):
(WebKit::ViewGestureController::setRenderTreeSize):
* UIProcess/mac/ViewGestureController.h:
Keep a side-map of page IDs to ViewGestureControllers, so that we can safely get back to
our ViewGestureController from the callback.

When the callback fires, if it succeeded, set m_shouldRemoveSnapshotWhenTargetRenderTreeSizeHit,
so that the commit (which is about to occur immediately after the callback returns) which calls
setRenderTreeSize will (perhaps) remove the snapshot.

If it failed, we remove the snapshot immediately, as this usually happens if the Web process crashed.

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

6 years agoFollowup to "rects sent to ServicesOverlayController are wrong"
beidson@apple.com [Thu, 3 Jul 2014 19:16:27 +0000 (19:16 +0000)]
Followup to "rects sent to ServicesOverlayController are wrong"
https://bugs.webkit.org/show_bug.cgi?id=134568

Rubberstamped by Tim Horton.

* WebProcess/WebPage/mac/ServicesOverlayController.mm:
(WebKit::ServicesOverlayController::drawSelectionHighlight): Don’t check to see if the
  proposed rect intersects the dirty rect. We always need to include all rects that form
  the selection when creating the DDHighlight.

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

6 years ago[WK2] RemoteLayerTreeDrawingAreaProxy re-checks a preference every commit for no...
timothy_horton@apple.com [Thu, 3 Jul 2014 19:04:34 +0000 (19:04 +0000)]
[WK2] RemoteLayerTreeDrawingAreaProxy re-checks a preference every commit for no reason
https://bugs.webkit.org/show_bug.cgi?id=134586

Reviewed by Benjamin Poulain.

* UIProcess/DrawingAreaProxy.h:
(WebKit::DrawingAreaProxy::setShouldShowDebugIndicator):
(WebKit::DrawingAreaProxy::showDebugIndicator): Deleted.
(WebKit::DrawingAreaProxy::isShowingDebugIndicator): Remove this, nobody is using it.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::preferencesDidChange):
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
(WebKit::RemoteLayerTreeDrawingAreaProxy::setShouldShowDebugIndicator):
(WebKit::RemoteLayerTreeDrawingAreaProxy::showDebugIndicator): Deleted.
Check the debug indicator pref at construction time, and update the state when it changes.
Checking it every commit was surprisingly expensive.

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

6 years agoSelection rects sent to ServicesOverlayController are wrong.
beidson@apple.com [Thu, 3 Jul 2014 17:56:38 +0000 (17:56 +0000)]
Selection rects sent to ServicesOverlayController are wrong.
<rdar://problem/16727796> and https://bugs.webkit.org/show_bug.cgi?id=134568

Reviewed by Darin Adler (and Tim Horton and Ryosuke Niwa).

Source/WebCore:
* WebCore.exp.in:

Update the gatherer to keep GapRects separate from LayoutRects:
* editing/SelectionRectGatherer.cpp:
(WebCore::SelectionRectGatherer::addRects):
(WebCore::SelectionRectGatherer::Notifier::~Notifier):
(WebCore::SelectionRectGatherer::clearAndCreateNotifier):
* editing/SelectionRectGatherer.h:

* page/EditorClient.h:
(WebCore::EditorClient::selectionRectsDidChange): Updated to take LayoutRects and GapRects separately.

Change RenderSelectionInfo to also hang on to the individual rects that formed the final bounding rect:
* rendering/RenderSelectionInfo.h:
(WebCore::RenderSelectionInfo::RenderSelectionInfo): If the RenderObject is a RenderText, then call
  collectSelectionRectsForLineBoxes instead of selectionRectForRepaint.
(WebCore::RenderSelectionInfo::rects):

* rendering/RenderText.cpp:
(WebCore::RenderText::collectSelectionRectsForLineBoxes): Added
(WebCore::RenderText::selectionRectForRepaint):
* rendering/RenderText.h:

* rendering/RenderTextLineBoxes.cpp:
(WebCore::RenderTextLineBoxes::collectSelectionRectsForRange): Added
* rendering/RenderTextLineBoxes.h:

* rendering/RenderView.cpp:
(WebCore::RenderView::setSubtreeSelection): Add the list of rects to the gatherer instead of just
  the bounding rect.

Source/WebKit2:
* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::selectionRectsDidChange): Also pass the GapRects to the ServicesOverlayController.
* WebProcess/WebCoreSupport/WebEditorClient.h:

* WebProcess/WebPage/ServicesOverlayController.h:
* WebProcess/WebPage/mac/ServicesOverlayController.mm:
(WebKit::expandForGap):
(WebKit::compactRectsWithGapRects): Combine 3+ rects down to exactly 3 rects, then expand them based on GapRects.
(WebKit::ServicesOverlayController::selectionRectsDidChange): Call compactRectsWithGapRects, then reverse the list.
(WebKit::ServicesOverlayController::drawSelectionHighlight): Tell data detectors to flip this.
(WebKit::ServicesOverlayController::drawTelephoneNumberHighlight): Tell data detectors to flip this.
(WebKit::ServicesOverlayController::drawCurrentHighlight): No need to flip this anymore.

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