Add -[WKNavigationAction modifierFlags] and -[WKNavigationAction buttonNumber]
https://bugs.webkit.org/show_bug.cgi?id=132880
<rdar://problem/16901354>

Reviewed by Dan Bernstein.

* Shared/API/Cocoa/WKFoundation.h:
Add typedef for older systems.

* UIProcess/API/Cocoa/WKNavigationAction.h:
Add -[WKNavigationAction modifierFlags] and -[WKNavigationAction buttonNumber]

* UIProcess/API/Cocoa/WKNavigationAction.mm:
(toWKNavigationType):
This can be static now.

(toNSEventModifierFlags):
Helper to convert WebEvent::Modifiers to NSEventModifierFlags.

(toNSButtonNumber):
Helper to convert WebMouseEvent::Button to an AppKit button number.

(-[WKNavigationAction initWithNavigationActionData:WebKit::]):
New initializer that takes a NavigationActionData and fills in the relevant ivars from it.

(-[WKNavigationAction _isUserInitiated]):
Return the new ivar.

* UIProcess/API/Cocoa/WKNavigationActionInternal.h:
Remove readwrite overrides.

* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::PolicyClient::decidePolicyForNavigationAction):
Use initWithNavigationActionData:

* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::UIClient::createNewPage):
Use initWithNavigationActionData:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168690 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Follow-up fix.

* UIProcess/API/Cocoa/WKNavigationAction.mm:
(-[WKNavigationAction _initWithNavigationActionData:WebKit::]):
(-[WKNavigationAction _isUserInitiated]):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Another follow-up build fix.

* Shared/API/Cocoa/WKFoundation.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168694 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Another follow-up build fix.

* Shared/API/Cocoa/WKFoundation.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168724 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS WK2] background-attachment:fixed behaves very poorly
https://bugs.webkit.org/show_bug.cgi?id=132881
<rdar://problem/16789526>

Reviewed by Beth Dakin.

Source/WebCore:

Remove the old ENABLE_FAST_MOBILE_SCROLLING code, and add a setting that
controls whether fixed backgrounds paint relative to the document, which
is enabled for iOS (WK1 and WK2). This setting is consulted when we repaint
fixed backgrounds on scrolling, when we paint them, and when we decide to make
a layer for fixed backgrounds.

* page/Settings.cpp:
* page/Settings.in:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::styleWillChange):
(WebCore::RenderElement::willBeRemovedFromTree):
(WebCore::shouldRepaintFixedBackgroundsOnScroll): Deleted.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::needsFixedRootBackgroundLayer):

Source/WTF:

Remove ENABLE_FAST_MOBILE_SCROLLING. Ports can use the fixedBackgroundsPaintRelativeToDocument
setting now.

* wtf/FeatureDefines.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168726 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Update positioning/drawing of the image controls button.
<rdar://problem/16885077> and https://bugs.webkit.org/show_bug.cgi?id=132883

Reviewed by Tim Horton.

* html/shadow/mac/ImageControlsButtonElementMac.cpp:
(WebCore::ImageControlsButtonElementMac::maybeCreate): Add inline style for top/right
  positioning based on the metrics from the render theme.

* html/shadow/mac/imageControlsMac.css:
(.x-webkit-image-controls-button): Can’t hard code any positioning.

* rendering/RenderTheme.h:
(WebCore::RenderTheme::imageControlsButtonPositionOffset):
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::servicesRolloverButtonCell):
(WebCore::RenderThemeMac::imageControlsButtonPositionOffset):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168728 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Win] Enum type with value zero is compatible with void*, potential cause of crashes.
https://bugs.webkit.org/show_bug.cgi?id=132772

Patch by peavo@outlook.com <peavo@outlook.com> on 2014-05-13
Reviewed by Geoffrey Garen.

Using the MSVC compiler, an instance of an enum type with value zero, is compatible with void* (see bug 132683 for a code example).
This has caused crashes on Windows on two occasions (bug 132683, and bug 121001).
This patch tries to prevent these type of crashes by using a type with explicit constructors instead of void*.
The void* parameter in the loadDouble and storeDouble methods are replaced with TrustedImmPtr.

* assembler/MacroAssemblerARM.h:
(JSC::MacroAssemblerARM::loadDouble):
(JSC::MacroAssemblerARM::storeDouble):
* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::loadDouble):
(JSC::MacroAssemblerARM64::storeDouble):
* assembler/MacroAssemblerARMv7.h:
(JSC::MacroAssemblerARMv7::loadDouble):
(JSC::MacroAssemblerARMv7::storeDouble):
* assembler/MacroAssemblerMIPS.h:
(JSC::MacroAssemblerMIPS::loadDouble):
(JSC::MacroAssemblerMIPS::storeDouble):
* assembler/MacroAssemblerSH4.h:
(JSC::MacroAssemblerSH4::loadDouble):
(JSC::MacroAssemblerSH4::storeDouble):
* assembler/MacroAssemblerX86.h:
(JSC::MacroAssemblerX86::storeDouble):
* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::absDouble):
(JSC::MacroAssemblerX86Common::negateDouble):
(JSC::MacroAssemblerX86Common::loadDouble):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::silentFill):
(JSC::DFG::compileClampDoubleToByte):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::fillSpeculateDouble):
(JSC::DFG::SpeculativeJIT::compile):
* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::purifyNaN):
* jit/JITInlines.h:
(JSC::JIT::emitLoadDouble):
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emitFloatTypedArrayGetByVal):
* jit/ThunkGenerators.cpp:
(JSC::floorThunkGenerator):
(JSC::roundThunkGenerator):
(JSC::powThunkGenerator):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168729 268f45cc-cd09-0410-ab3c-d52691b4dbfc
DYEBench should run 20 iterations in browser
https://bugs.webkit.org/show_bug.cgi?id=132795

Reviewed by Gavin Barraclough.

Right now, run-perf-tests runs BYEBench 4 times with different instances of DRT/WTR to get
a more stable time and account for differences in the runtime environment, particularly,
ASLR (Address Space Layout Randomization).

While we can't account for the latter effect when the benchmark is ran inside a browser,
we can at least run 20 iterations to get a more stable (but perhaps biased by ALSR) number.

While the sample size of 20 is statistically unsound to compute the arithmetic mean from,
it's MUCH better than the current sample size of 5.

* DoYouEvenBench/Full.html:
(benchmarkClient.iterationCount): Set the default iteration count to 20.
(startTest): Use benchmarkClient.iterationCount as the iteration count.
* DoYouEvenBench/resources/benchmark-report.js:
(benchmarkClient.iterationCount): Continue to use the old iteration count of 5 when ran
inside run-perf-tests.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168732 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add some illustrations about how JSC works.

* blog-files/ftl-jit: Added.
* blog-files/ftl-jit/dfg_pipeline.png: Added.
* blog-files/ftl-jit/four_tier_performance.png: Added.
* blog-files/ftl-jit/ftl_asm_bench_performance.png: Added.
* blog-files/ftl-jit/ftl_pipeline.png: Added.
* blog-files/ftl-jit/ftl_timeline.png: Added.
* blog-files/ftl-jit/object_model.png: Added.
* blog-files/ftl-jit/polymorphic_inlining_performance.png: Added.
* blog-files/ftl-jit/polyvariance.png: Added.
* blog-files/ftl-jit/polyvariant_devirtualization_performance.png: Added.
* blog-files/ftl-jit/three_tier_performance.png: Added.
* blog-files/ftl-jit/three_tiers.png: Added.



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