WebKit-https.git
6 years agoAttempt to fix the tests.
weinig@apple.com [Mon, 21 Apr 2014 21:44:34 +0000 (21:44 +0000)]
Attempt to fix the tests.

* TestWebKitAPI/Tests/WebKit2Cocoa/Navigation.mm:
(-[DidFailProvisionalNavigationDelegate webView:decidePolicyForNavigationAction:decisionHandler:]):
Add policy handler to override the new default of denying loads that NSURLConnection cannot handle.

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

6 years agoDon't use ProcessAssertion on simulator
barraclough@apple.com [Mon, 21 Apr 2014 21:33:50 +0000 (21:33 +0000)]
Don't use ProcessAssertion on simulator
https://bugs.webkit.org/show_bug.cgi?id=131950

Rubber stamped by Enrica Casucci

* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::connectToService):
* UIProcess/ios/ProcessAssertion.h:

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

6 years ago[iOS WebKit2] support replacements for misspelled words.
enrica@apple.com [Mon, 21 Apr 2014 21:14:30 +0000 (21:14 +0000)]
[iOS WebKit2] support replacements for misspelled words.
https://bugs.webkit.org/show_bug.cgi?id=131827
<rdar://problem/16319657>

Reviewed by Darin Adler.

Source/WebCore:
Adds utility function to return the character before the current selection
and converts the nbsp to the space character.

* WebCore.exp.in:
* editing/VisibleUnits.cpp:
(WebCore::characterBeforePosition):
* editing/VisibleUnits.h:

Source/WebKit2:
This is the second a final piece to support replacements.
It adds some entrypoints used by the keyboard code to perform
replacement when reaching the edge of a word using backspace.
I've modified the behavior of replaceSelectedText to work both
with caret or range selections.

* Shared/EditorState.cpp:
(WebKit::EditorState::encode):
(WebKit::EditorState::decode):
* Shared/EditorState.h:
(WebKit::EditorState::EditorState):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView isReplaceAllowed]):
(-[WKContentView _characterBeforeCaretSelection]):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::editorState):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::replaceSelectedText):

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

6 years ago[iOS] enable plug-in replacement
eric.carlson@apple.com [Mon, 21 Apr 2014 21:06:57 +0000 (21:06 +0000)]
[iOS] enable plug-in replacement
https://bugs.webkit.org/show_bug.cgi?id=131947

Reviewed by Jer Noble.

* bindings/generic/RuntimeEnabledFeatures.cpp:
(WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures): initialize m_isPluginReplacementEnabled
    to true on iOS.

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

6 years agoDon't use ProcessAssertion on simulator
barraclough@apple.com [Mon, 21 Apr 2014 21:00:49 +0000 (21:00 +0000)]
Don't use ProcessAssertion on simulator
https://bugs.webkit.org/show_bug.cgi?id=131950

Rubber stamped by Benjamin Poulain

* UIProcess/ios/ProcessAssertion.mm:
(WebKit::ProcessAssertion::ProcessAssertion):
(WebKit::ProcessAssertion::setState):

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

6 years agoAnother build fix.
andersca@apple.com [Mon, 21 Apr 2014 20:44:59 +0000 (20:44 +0000)]
Another build fix.

* Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
(WebKit::XPCServiceInitializerDelegate::checkEntitlements):

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

6 years ago[CSS Blending] Remove support for non-separable blend modes from mix-blend-mode
cabanier@adobe.com [Mon, 21 Apr 2014 20:44:01 +0000 (20:44 +0000)]
[CSS Blending] Remove support for non-separable blend modes from mix-blend-mode
https://bugs.webkit.org/show_bug.cgi?id=131824

Reviewed by Dean Jackson.

Source/WebCore:
Removed support for non-separable blend modes from the CSS parser.

Covered by existing tests

* css/CSSParser.cpp:
(WebCore::isValidKeywordPropertyAndValue):
* platform/graphics/ca/mac/PlatformCAFiltersMac.mm:
(PlatformCAFilters::setBlendingFiltersOnLayer):

LayoutTests:
Removed or updated tests that used non-separable blend modes in combination
with mix-blend-mode.

* css3/compositing/blend-mode-property-expected.txt:
* css3/compositing/blend-mode-property-parsing-expected.txt:
* css3/compositing/blend-mode-simple-composited.html:
* css3/compositing/blend-mode-simple.html:
* css3/compositing/script-tests/blend-mode-property-parsing.js:
* css3/compositing/script-tests/blend-mode-property.js:
* css3/compositing/svg-blend-color.html: Removed.
* css3/compositing/svg-blend-hue.html: Removed.
* css3/compositing/svg-blend-luminosity.html: Removed.
* css3/compositing/svg-blend-saturation.html: Removed.
* platform/mac/css3/compositing/blend-mode-simple-composited-expected.txt:
* platform/mac/css3/compositing/blend-mode-simple-expected.txt:

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

6 years ago[New Multicolumn] vertical-rl/unsplittable-inline-block misrenders the column rule.
hyatt@apple.com [Mon, 21 Apr 2014 20:39:33 +0000 (20:39 +0000)]
[New Multicolumn] vertical-rl/unsplittable-inline-block misrenders the column rule.
https://bugs.webkit.org/show_bug.cgi?id=131818

Reviewed by Anders Carlsson.

Patch the test to be column-fill:auto, since the other versions
of the test all had that specified already.

* fast/multicol/vertical-rl/unsplittable-inline-block.html:

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

6 years agoBuild fix.
andersca@apple.com [Mon, 21 Apr 2014 20:35:25 +0000 (20:35 +0000)]
Build fix.

* Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
(WebKit::XPCServiceInitializer):

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

6 years ago[New Multicolumn] Column set drawing under horizontal scrollbar.
hyatt@apple.com [Mon, 21 Apr 2014 20:20:27 +0000 (20:20 +0000)]
[New Multicolumn] Column set drawing under horizontal scrollbar.
https://bugs.webkit.org/show_bug.cgi?id=131812.

Reviewed by Sam Weinig.

Source/WebCore:
Added fast/multicol/newmulticol/compare-with-old-impl/LeftToRight-tb.html.

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::layoutBlock):
(WebCore::RenderBlockFlow::checkForPaginationLogicalHeightChange):
* rendering/RenderBlockFlow.h:
Pass in relayoutChildren as a reference boolean to checkForPaginationLogicalHeightChange.
The new columns need to be able to set it to true if the amount of available column
height ever changes, so that the RenderFlowThread and the sets get a layout call.

* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::setColumnStylesFromPaginationMode):
Make sure that the pagination mode is set up with an auto column-fill specified. You
don't ever want to balance when you set a pagination mode on the RenderView.

LayoutTests:
* fast/multicol/newmulticol/compare-with-old-impl/LeftToRight-tb-expected.html: Added.
* fast/multicol/newmulticol/compare-with-old-impl/LeftToRight-tb.html: Added.

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

6 years ago[iOS WebKit2] Implement CSS viewport units
timothy_horton@apple.com [Mon, 21 Apr 2014 20:16:50 +0000 (20:16 +0000)]
[iOS WebKit2] Implement CSS viewport units
https://bugs.webkit.org/show_bug.cgi?id=131863
<rdar://problem/16279088>

Reviewed by Darin Adler.

* UIProcess/API/Cocoa/WKWebView.mm:
(setMinimumLayoutSizeForMinimalUI):
(-[WKWebView _minimumLayoutSizeOverrideForMinimalUI]):
(-[WKWebView _setMinimumLayoutSizeOverrideForMinimalUI:]):
Add _setMinimumLayoutSizeOverrideForMinimalUI:, which pushes said size
down from the client to WebPageIOS, below.

* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::setMinimumLayoutSizeForMinimalUI):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::setMinimumLayoutSizeForMinimalUI):
(WebKit::WebPage::viewportConfigurationChanged):
Update FrameView's viewport size based on the minimum layout size for minimal UI (if we have it)
or the normal minimum layout size, scaled to the page's initial scale.

* WebCore.exp.in:
* page/FrameView.cpp:
(WebCore::FrameView::setViewportSize):
* page/FrameView.h:
(WebCore::FrameView::viewportSize):
Add setViewportSize() and viewportSize().
If the viewport size changes, we have to do style recalc.
If we have an overridden viewport size, use it.

* rendering/RenderView.cpp:
(WebCore::RenderView::viewportSize):
* rendering/RenderView.h:
Get the size from FrameView.

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

6 years ago[iOS][WK2] Fix the dynamic viewport update when the viewport's max-scale conflict...
benjamin@webkit.org [Mon, 21 Apr 2014 20:14:05 +0000 (20:14 +0000)]
[iOS][WK2] Fix the dynamic viewport update when the viewport's max-scale conflict with the transition
https://bugs.webkit.org/show_bug.cgi?id=131884

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

<rdar://problem/16667291>

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _beginAnimatedResizeWithUpdates:]):
It is fairly common to have a viewport configuration with min-scale=1 and max-scale=1.
Since we were only changing the minimumScale for the transition, the target scale was affected
by max-scale. This was breaking the transition from portrait to landscale.

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

6 years ago[iOS][WK2] Make dynamic viewport size update content aware
benjamin@webkit.org [Mon, 21 Apr 2014 20:10:12 +0000 (20:10 +0000)]
[iOS][WK2] Make dynamic viewport size update content aware
https://bugs.webkit.org/show_bug.cgi?id=131874

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

When possible, adjust the scroll position based on the content on dynamic viewport resize.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
(WebKit::WebPage::scalePage):
(WebKit::WebPage::pageDidScroll):
* WebProcess/WebPage/WebPage.h:
The scrolling heuristic are not invertible, especially the content heuristic. To have the right
behavior when doing resize without changing the page, we save the old scroll position and restore
it when the content size and scale is restored.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::dynamicViewportSizeUpdate):
On dynamic update, start by finding what node is at the center of the screen. After the layout, put that
node back in the center.

(WebKit::WebPage::updateVisibleContentRects):

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

6 years agoSource/JavaScriptCore: Unreviewed test gardening, run the repeat-out-of-bounds tests...
fpizlo@apple.com [Mon, 21 Apr 2014 19:53:55 +0000 (19:53 +0000)]
Source/JavaScriptCore: Unreviewed test gardening, run the repeat-out-of-bounds tests again.

* tests/stress/float32-repeat-out-of-bounds.js:
* tests/stress/int8-repeat-out-of-bounds.js:

Tools: Unreviewed test gardening, make no-eager runs run everything except eager (as opposed to
being the same as a "quick run", which is meant for genuinely slow tests).

* Scripts/run-jsc-stress-tests:

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

6 years agoOSR exit should know about Int52 and Double constants
fpizlo@apple.com [Mon, 21 Apr 2014 19:51:54 +0000 (19:51 +0000)]
OSR exit should know about Int52 and Double constants
https://bugs.webkit.org/show_bug.cgi?id=131945

Reviewed by Oliver Hunt.

The DFG OSR exit machinery's ignorance would lead to some constants becoming
jsUndefined() after OSR exit.

The FTL OSR exit machinery's ignorance just meant that we would sometimes use a
stackmap constant rather than baking the constant into the OSRExit data structure.
So, not a big deal, but worth fixing.

Also added some helpful hacks to jsc.cpp for testing such OSR exit pathologies.

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsic):
* dfg/DFGMinifiedNode.h:
(JSC::DFG::belongsInMinifiedGraph):
(JSC::DFG::MinifiedNode::hasConstantNumber):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::tryToSetConstantExitArgument):
* jsc.cpp:
(GlobalObject::finishCreation):
(functionOtherFalse):
(functionUndefined):
* runtime/Intrinsic.h:
* tests/stress/fold-to-double-constant-then-exit.js: Added.
(foo):
* tests/stress/fold-to-int52-constant-then-exit.js: Added.
(foo):

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

6 years agoNeed default WKNavigationDelegate behavior
andersca@apple.com [Mon, 21 Apr 2014 19:51:01 +0000 (19:51 +0000)]
Need default WKNavigationDelegate behavior
https://bugs.webkit.org/show_bug.cgi?id=131944
<rdar://problem/15949822>

Reviewed by Dan Bernstein.

Port the WebKit1 default delegate behavior over.

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

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

6 years ago[Cocoa] Expose WebPage::setDefersLoading
mitz@apple.com [Mon, 21 Apr 2014 19:49:00 +0000 (19:49 +0000)]
[Cocoa] Expose WebPage::setDefersLoading
https://bugs.webkit.org/show_bug.cgi?id=131943

Reviewed by Anders Carlsson, but he doesn’t like this.

* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(-[WKWebProcessPlugInBrowserContextController _defersLoading]): Added this accessor.
(-[WKWebProcessPlugInBrowserContextController _setDefersLoading:]): Ditto.
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h:
Declared new property _defersLoading.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::defersLoading): Added this getter.
* WebProcess/WebPage/WebPage.h:

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

6 years agoRemove unused WebKitSystemInterface functions
commit-queue@webkit.org [Mon, 21 Apr 2014 19:48:12 +0000 (19:48 +0000)]
Remove unused WebKitSystemInterface functions
https://bugs.webkit.org/show_bug.cgi?id=131938

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2014-04-21
Reviewed by Alexey Proskuryakov.

Source/WebCore:
* WebCore.exp.in:
* platform/ios/WebCoreSystemInterfaceIOS.mm:
* platform/mac/WebCoreSystemInterface.h:
* platform/mac/WebCoreSystemInterface.mm:

Source/WebKit/mac:
* WebCoreSupport/WebSystemInterface.mm:
(InitWebCoreSystemInterface):

Source/WebKit2:
* WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
(InitWebCoreSystemInterface):

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

6 years agoProvide feedback when we encounter an unrecognied node in the FTL backend.
fpizlo@apple.com [Mon, 21 Apr 2014 19:41:34 +0000 (19:41 +0000)]
Provide feedback when we encounter an unrecognied node in the FTL backend.

Rubber stamped by Alexey Proskuryakov.

* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::compileNode):

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

6 years agoUpdate results of fast/images/image-controls-basic.html
ap@apple.com [Mon, 21 Apr 2014 19:37:43 +0000 (19:37 +0000)]
Update results of fast/images/image-controls-basic.html

* platform/mac/TestExpectations:
* platform/mac/fast/images/image-controls-basic-expected.png:
* platform/mac/fast/images/image-controls-basic-expected.txt:

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

6 years ago[New Multicolumn] Add test case for shrink-to-column-height now that
hyatt@apple.com [Mon, 21 Apr 2014 19:17:43 +0000 (19:17 +0000)]
[New Multicolumn] Add test case for shrink-to-column-height now that
it passes in the new impl.
https://bugs.webkit.org/show_bug.cgi?id=131814

Reviewed by Dean Jackson.

* fast/multicol/newmulticol/compare-with-old-impl/shrink-to-column-height-for-pagination-expected.html: Added.
* fast/multicol/newmulticol/compare-with-old-impl/shrink-to-column-height-for-pagination.html: Added.

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

6 years agoMove the JSString cache from DOMWrapperWorld to VM.
akling@apple.com [Mon, 21 Apr 2014 19:17:14 +0000 (19:17 +0000)]
Move the JSString cache from DOMWrapperWorld to VM.
<https://webkit.org/b/131940>

Source/JavaScriptCore:
Reviewed by Geoff Garen.

* runtime/VM.h:

Source/WebCore:
Since there's no need for JSStrings to be world-specific, this patch
moves the string cache to JSC::VM. This makes jsStringWithCache()
a lot faster since it no longer has to jump through twenty-eleven
hoops to find the DOMWrapperWorld.

Reviewed by Geoff Garen.

* bindings/js/DOMWrapperWorld.cpp:
(WebCore::DOMWrapperWorld::clearWrappers):
* bindings/js/DOMWrapperWorld.h:
* bindings/js/JSDOMBinding.cpp:
(WebCore::jsStringWithCache):

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

6 years ago[GTK] Unreviewed GTK gardening
commit-queue@webkit.org [Mon, 21 Apr 2014 19:15:17 +0000 (19:15 +0000)]
[GTK] Unreviewed GTK gardening

Update gtk/TestExpectations and rebaseline some gtk test results.

Patch by Carlos Alberto Lopez Perez <clopez@igalia.com> on 2014-04-21

* platform/gtk/TestExpectations: Mark fast/repaint/hidpi-wrong-repaint-rect-when-parent-has-noncompositing-transform.html
as failure and fast/dom/Window/mozilla-focus-blur.html as flaky.
* platform/gtk/fast/multicol/newmulticol/client-rects-expected.txt: Rebaseline after r167335.
* platform/gtk/fast/repaint/reflection-redraw-expected.txt: Rebaseline after r167568.
* platform/gtk/fast/table/dynamic-caption-add-remove-before-child-expected.txt: Rebaseline after r167568.
* platform/gtk/fast/table/multiple-captions-display-expected.txt: Rebaseline after r167568.
* platform/gtk/tables/mozilla/marvin/body_col-expected.txt: Rebaseline after r167568.
* platform/gtk/tables/mozilla/marvin/x_th_valign_baseline-expected.txt: Rebaseline after r167568.
* platform/gtk/tables/mozilla/other/body_col-expected.txt: Rebaseline after r167568.
* platform/gtk/tables/mozilla_expected_failures/bugs/bug10140-expected.txt: Rebaseline after r167568.
* platform/gtk/tables/mozilla_expected_failures/bugs/bug10216-expected.txt: Rebaseline after r167568.
* platform/gtk/tables/mozilla_expected_failures/core/captions3-expected.txt: Rebaseline after r167568.
* platform/gtk/tables/mozilla_expected_failures/other/test4-expected.txt: Rebaseline after r167568.
* platform/gtk/fast/repaint/spanner-with-margin-expected.txt: Added. Rebaseline after r167439.

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

6 years agoCheck the com.apple.security.network.client entitlement for all processes
andersca@apple.com [Mon, 21 Apr 2014 19:10:33 +0000 (19:10 +0000)]
Check the com.apple.security.network.client entitlement for all processes
https://bugs.webkit.org/show_bug.cgi?id=131942
<rdar://problem/12354188>

Reviewed by Dan Bernstein.

* NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm:
(WebKit::NetworkServiceInitializerDelegate::NetworkServiceInitializerDelegate):
* Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
* Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
(WebKit::XPCServiceInitializerDelegate::checkEntitlements):

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

6 years agoSource/WebCore: [New Multicolumn] Column balancing is slow on float-multicol.html
hyatt@apple.com [Mon, 21 Apr 2014 19:05:23 +0000 (19:05 +0000)]
Source/WebCore: [New Multicolumn] Column balancing is slow on float-multicol.html
https://bugs.webkit.org/show_bug.cgi?id=131801

Reviewed by Enrica Casucci.

Added fast/multicol/tall-float.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::expandsToEncloseOverhangingFloats):
Make RenderFlowThreads expand to encompass floats. Also from Morten's patch for
Blink (#361551).

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::computeOverflow):
Fix a bug where the new multi-column code was adding in overflow for floats
when it should not. This was resulting in the creation of scrollbars when none
should exist. This is my own addition.

(WebCore::RenderBlockFlow::addOverhangingFloats):
Make RenderFlowThreads and RenderRegions ignore overhanging float additions. This
comes from Morten's patch for Blink (#361551).

LayoutTests: http/tests/cache/subresource-failover-to-network.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=131936

Patch by Alexey Proskuryakov <ap@apple.com> on 2014-04-21
Reviewed by Brady Eidson.

The test was racy, because it was unintentionally queuing TestRunner operations
twice. Also, it failed to clean up its cookie.

Rewrote to not use TestRunner queuing, making the test work in browser.

* http/tests/cache/resources/subresource-failover-to-network.cgi:
* http/tests/cache/subresource-failover-to-network.html:

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

6 years agohttp/tests/cache/subresource-failover-to-network.html is flaky
ap@apple.com [Mon, 21 Apr 2014 18:55:14 +0000 (18:55 +0000)]
http/tests/cache/subresource-failover-to-network.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=131936

Reviewed by Brady Eidson.

The test was racy, because it was unintentionally queuing TestRunner operations
twice. Also, it failed to clean up its cookie.

Rewrote to not use TestRunner queuing, making the test work in browser.

* http/tests/cache/resources/subresource-failover-to-network.cgi:
* http/tests/cache/subresource-failover-to-network.html:

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

6 years agoTake block execution count estimates into account when voting double
fpizlo@apple.com [Mon, 21 Apr 2014 18:43:01 +0000 (18:43 +0000)]
Take block execution count estimates into account when voting double
https://bugs.webkit.org/show_bug.cgi?id=131906

Reviewed by Geoffrey Garen.

This was a drama in three acts.

Act I: Slurp in BasicBlock::executionCount and use it as a weight when counting the
    number of uses of a variable that want double or non-double. Easy as pie. This
    gave me a huge speed-up on FloatMM and a huge slow-down on basically everything
    else.

Act II: Realize that there were some programs where our previous double voting was
    just on the edge of disaster and making it more precise tipped it over. In
    particular, if you had an integer variable that would infrequently be used in a
    computation that resulted in a variable that was frequently used as an array index,
    the outer infrequentness would be the thing we'd use in the vote. So, an array
    index would become double. We fix this by reviving global backwards propagation
    and introducing the concept of ReallyWantsInt, which is used just for array
    indices. Any variable transitively flagged as ReallyWantsInt will never be forced
    double. We need that flag to be separate from UsedAsInt, since UsedAsInt needs to
    be set in bitops for RageConversion but using it for double forcing is too much.
    Basically, it's cheaper to have to convert a double to an int for a bitop than it
    is to convert a double to an int for an array index; also a variable being used as
    an array index is a much stronger hint that it ought to be an int. This recovered
    performance on everything except programs that used FTL OSR entry.

Act III: Realize that OSR entrypoint creation creates blocks that have NaN execution
    count, which then completely pollutes the weighting - essentially all votes go
    NaN. Fix this with some surgical defenses. Basically, any client of execution
    counts should allow for them to be NaN and shouldn't completely fall off a cliff
    when it happens.

This is awesome. 75% speed-up on FloatMM. 11% speed-up on audio-dft. This leads to
7% speed-up on AsmBench and 2% speed-up on Kraken.

* CMakeLists.txt:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* dfg/DFGBackwardsPropagationPhase.cpp:
(JSC::DFG::BackwardsPropagationPhase::run):
(JSC::DFG::BackwardsPropagationPhase::propagate):
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::dumpBlockHeader):
* dfg/DFGGraph.h:
(JSC::DFG::Graph::voteNode):
(JSC::DFG::Graph::voteChildren):
* dfg/DFGNodeFlags.cpp:
(JSC::DFG::dumpNodeFlags):
* dfg/DFGNodeFlags.h:
* dfg/DFGOSREntrypointCreationPhase.cpp:
(JSC::DFG::OSREntrypointCreationPhase::run):
* dfg/DFGPlan.cpp:
(JSC::DFG::Plan::compileInThreadImpl):
* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::doDoubleVoting):
(JSC::DFG::PredictionPropagationPhase::doRoundOfDoubleVoting):
* dfg/DFGVariableAccessData.cpp: Added.
(JSC::DFG::VariableAccessData::VariableAccessData):
(JSC::DFG::VariableAccessData::mergeIsCaptured):
(JSC::DFG::VariableAccessData::mergeShouldNeverUnbox):
(JSC::DFG::VariableAccessData::predict):
(JSC::DFG::VariableAccessData::mergeArgumentAwarePrediction):
(JSC::DFG::VariableAccessData::shouldUseDoubleFormatAccordingToVote):
(JSC::DFG::VariableAccessData::tallyVotesForShouldUseDoubleFormat):
(JSC::DFG::VariableAccessData::mergeDoubleFormatState):
(JSC::DFG::VariableAccessData::makePredictionForDoubleFormat):
(JSC::DFG::VariableAccessData::flushFormat):
* dfg/DFGVariableAccessData.h:
(JSC::DFG::VariableAccessData::vote):
(JSC::DFG::VariableAccessData::VariableAccessData): Deleted.
(JSC::DFG::VariableAccessData::mergeIsCaptured): Deleted.
(JSC::DFG::VariableAccessData::mergeShouldNeverUnbox): Deleted.
(JSC::DFG::VariableAccessData::predict): Deleted.
(JSC::DFG::VariableAccessData::mergeArgumentAwarePrediction): Deleted.
(JSC::DFG::VariableAccessData::shouldUseDoubleFormatAccordingToVote): Deleted.
(JSC::DFG::VariableAccessData::tallyVotesForShouldUseDoubleFormat): Deleted.
(JSC::DFG::VariableAccessData::mergeDoubleFormatState): Deleted.
(JSC::DFG::VariableAccessData::makePredictionForDoubleFormat): Deleted.
(JSC::DFG::VariableAccessData::flushFormat): Deleted.

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

6 years agoREGRESSION(r167591): ARM64 and ARM traditional builds broken
msaboff@apple.com [Mon, 21 Apr 2014 18:10:41 +0000 (18:10 +0000)]
REGRESSION(r167591): ARM64 and ARM traditional builds broken
https://bugs.webkit.org/show_bug.cgi?id=131935

Reviewed by Mark Hahnenberg.

Added store8(TrustedImm32, MacroAssembler::Address) to the ARM traditional and ARM64
macro assemblers.  Added a new test for the original patch.

* assembler/MacroAssemblerARM.h:
(JSC::MacroAssemblerARM::store8):
* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::store8):
* tests/stress/dfg-create-arguments-inline-alloc.js: New test.

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

6 years agoREGRESSION (r160908): Safari doesn't draw rotated images properly first time
darin@apple.com [Mon, 21 Apr 2014 18:08:49 +0000 (18:08 +0000)]
REGRESSION (r160908): Safari doesn't draw rotated images properly first time
https://bugs.webkit.org/show_bug.cgi?id=131930

Reviewed by Anders Carlsson.

With render tree creation sufficiently lazy, we had to put some explicit
calls to updateStyleIfNeeded into the ImageDocument class.

* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createDocument): Pass a Frame&.

* html/ImageDocument.cpp:
(WebCore::ImageDocument::imageSize): Added this helper function. This updates
style so we can use the renderer to compute an image size taking things like
orientation into account, and also passes in the zoom factor.
(WebCore::ImageDocument::updateDuringParsing): Moved the body of the
ImageDocumentParser::appendBytes function into this function. Since it's a
member of ImageDocument, it has better access to appropriate private members,
and we don't have to expose as many functions to the public. Also changed to
not use the frame so much. Also merged in the code that creates the document
instead of having it be a side effect in the cachedImage helper function; all
the other call sites were checking for null before calling cachedImage.
(WebCore::ImageDocument::finishedParsing): Moved the body of the
ImageDocumentParser::finish function here. Added a call to updateStyleIfNeeded
before using the renderer to get the image size.
(WebCore::ImageDocumentParser::document): Made this return a reference. It's
just a convenience function used in the two functions below.
(WebCore::ImageDocumentParser::appendBytes): Just call updateDuringParsing.
(WebCore::ImageDocumentParser::finish): Just call finishedParsing.
(WebCore::ImageDocument::ImageDocument): Take a reference for the argument,
use nullptr, and also initialize m_shouldShrinkImage directly instead of using
a shouldShrinkToFit() helper function to do it.
(WebCore::ImageDocument::createDocumentStructure): Removed unneeded check of
null for the frame, since the caller does it. Removed some unneeded
IGNORE_EXCEPTON and a stray semicolon. Use m_shouldShrinkImage instead of
calling shouldShrinkToFit since at this early point they will be identical.
(WebCore::ImageDocument::scale): Make non-const so we can call the new
imageSize helper. Use Document::view instead of Frame::view. Improved the
conversion to floating point so it doesn't involve a static_cast and an extra
conversion from int to LayoutUnit.
(WebCore::ImageDocument::resizeImageToFit): Ditto.
(WebCore::ImageDocument::imageClicked): Ditto.
(WebCore::ImageDocument::imageUpdated): Ditto. Also use m_shouldShrinkImage
ibnstead of shouldShrinkToFit.
(WebCore::ImageDocument::restoreImageSize): Ditto.
(WebCore::ImageDocument::imageFitsInWindow): Ditto.
(WebCore::ImageDocument::windowSizeChanged): Ditto.
(WebCore::ImageDocument::cachedImage): Deleted. Moved logic into updateDuringParsing.
(WebCore::ImageDocument::shouldShrinkToFit): Deleted. Moved logic into constructor.
(WebCore::ImageEventListener::handleEvent): Updated for changes above.
(WebCore::ImageEventListener::operator==): Simplified. No reason this has to check
whether both listeners are in the same document.
(WebCore::ImageDocumentElement::didMoveToNewDocument): Use nullptr.

* html/ImageDocument.h: Deleted some unused things, updated for changes above,
and made some memer functions private.

* loader/FrameLoaderClient.h: Deleted the allowScriptFromSource, allowPlugins,
allowImage, and allowDisplayingInsecureContent functions. These were only used in
Chromium and are now unneeded complexity. We could bring them back if anyone wants them.

* loader/MixedContentChecker.cpp:
(WebCore::MixedContentChecker::canDisplayInsecureContent): Removed call to
allowDisplayingInsecureContent, just use the setting directly.
(WebCore::MixedContentChecker::canRunInsecureContent): Removed call to
allowRunningInsecureContent, just use the setting directly.

* loader/SubframeLoader.cpp:
(WebCore::SubframeLoader::allowPlugins): Removed call to allowPlugins, just
use the arePluginsEnabled setting directly.

* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::canRequest): Removed call to allowScriptFromSource, just
use the isScriptEnabled setting directly.
(WebCore::CachedResourceLoader::clientDefersImage): Removed call to allowImage.

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

6 years ago[New Multicolumn] Pagination mode messed up with non-inline axis and reversed direction.
hyatt@apple.com [Mon, 21 Apr 2014 18:07:15 +0000 (18:07 +0000)]
[New Multicolumn] Pagination mode messed up with non-inline axis and reversed direction.
https://bugs.webkit.org/show_bug.cgi?id=131811

Reviewed by Dean Jackson.

Source/WebCore:
Added fast/multicol/newmulticol/compare-with-old-impl/BottomToTop-tb.html

With block axis pagination mode, it is possible to set a column height that is not the same
as the available fill height for a block. The new multi-column code had the assumption that
the column height was the same as the amount of fill room you had available. This is not
the case.

To correct the issue, I added a member variable to RenderMultiColumnSet that stores the
available column height as a separate variable from the computed column height. This allows
the pagination API to specify a different column height that is not the same as the view's
content height.

Even though it isn't involved in the solution, I also patched pageOrViewLogicalHeight on
RenderView to work with the new column code as well.

To address the layout test failures (that caused the previous rollout), I made sure to
initialize m_availableHeight to 0 when m_computedColumnHeight also gets reset to 0.

The assertion is not something I could reproduce on any machine, but I can see the problem.
I patched Page's pageCount method to not have column code directly in Page.cpp,
and to make a new pageCount() method on RenderView that Page calls
into. This method is now patched to handle the new column code as well as the old. I have
no real way of testing this method though, since I can't reproduce the assertion that the
bots were experiencing.

* page/Page.cpp:
(WebCore::Page::pageCount):
* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::RenderMultiColumnSet):
(WebCore::RenderMultiColumnSet::setAndConstrainColumnHeight):
(WebCore::RenderMultiColumnSet::prepareForLayout):
(WebCore::RenderMultiColumnSet::computeLogicalHeight):
* rendering/RenderMultiColumnSet.h:
* rendering/RenderView.cpp:
(WebCore::RenderView::pageOrViewLogicalHeight):
(WebCore::RenderView::pageCount):
* rendering/RenderView.h:

LayoutTests:
* fast/multicol/newmulticol/compare-with-old-impl/BottomToTop-tb-expected.html: Added.
* fast/multicol/newmulticol/compare-with-old-impl/BottomToTop-tb.html: Added.

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

6 years ago[Media] Clean up localized strings in controls
dino@apple.com [Mon, 21 Apr 2014 18:06:20 +0000 (18:06 +0000)]
[Media] Clean up localized strings in controls
https://bugs.webkit.org/show_bug.cgi?id=131857
<rdar://problem/16663005>

Reviewed by Eric Carlson.

There is no need for separate localization files
on OS X and iOS. Move the small number of iOS-specific
localizations into a shared file.

We also don't need a function to return a static table.
Ultimately I think we want a top-level WebKit object that
hold the table, but for now use a global variable
called UIStringTable. Since we're in an isolated world, we
won't clash with anything.

I noticed a few cases were we grab a localized string and
then instantly run a replacement on it. This should be
supported directly in the UIString() accessor.

* English.lproj/mediaControlsLocalizedStrings.js: Add iOS strings. Just
use a static table.
(mediaControlsLocalizedStrings): Deleted.
* English.lproj/mediaControlsLocalizedStringsiOS.js: Removed.
* Modules/mediacontrols/mediaControlsApple.js:
(Controller.prototype.extend): Fix braces.
(Controller.prototype.UIString): Use the string table, and allow replacement.
(Controller.prototype.createControls): Use new UIString replacement.
* Modules/mediacontrols/mediaControlsiOS.js:
(ControllerIOS.prototype.updateWirelessPlaybackStatus): Use new UIString.
(ControllerIOS.prototype.UIString): Deleted. Use the parent class version.
* WebCore.xcodeproj/project.pbxproj: Remove file from Resources.
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::mediaControlsScript): No need to include the iOS
specific localization file.

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

6 years ago[Win] Unreviewed build fix.
bfulgham@apple.com [Mon, 21 Apr 2014 17:31:13 +0000 (17:31 +0000)]
[Win] Unreviewed build fix.

* inspector/TimelineRecordFactory.cpp: Add missing include.

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

6 years agoMove cross-port Source/WebCore/page/ code to std::unique_ptr
zandobersek@gmail.com [Mon, 21 Apr 2014 17:11:43 +0000 (17:11 +0000)]
Move cross-port Source/WebCore/page/ code to std::unique_ptr
https://bugs.webkit.org/show_bug.cgi?id=130534

Reviewed by Darin Adler.

Source/WebCore:
Replace uses of OwnPtr and PassOwnPtr in cross-port code under Source/WebCore/page/ with
std::unique_ptr. Unnecessary OwnPtr.h and PassOwnPtr.h header inclusions are removed as well.

* dom/Document.cpp:
(WebCore::Document::initSecurityContext):
* dom/SecurityContext.cpp:
(WebCore::SecurityContext::setContentSecurityPolicy):
* dom/SecurityContext.h:
* page/CaptionUserPreferences.h:
* page/ContentSecurityPolicy.cpp:
(WebCore::CSPDirectiveList::create):
(WebCore::CSPDirectiveList::checkEvalAndReportViolation):
(WebCore::CSPDirectiveList::checkInlineAndReportViolation):
(WebCore::CSPDirectiveList::checkSourceAndReportViolation):
(WebCore::CSPDirectiveList::setCSPDirective):
(WebCore::ContentSecurityPolicy::didReceiveHeader):
* page/ContentSecurityPolicy.h:
* page/DOMSecurityPolicy.h:
* page/DOMWindow.cpp:
(WebCore::PostMessageTimer::fired):
(WebCore::DOMWindow::postMessageTimerFired):
* page/DOMWindow.h:
* page/EventHandler.cpp:
(WebCore::EventHandler::EventHandler):
* page/EventHandler.h:
* page/Frame.cpp:
(WebCore::Frame::Frame):
(WebCore::createRegExpForLabels):
(WebCore::Frame::searchForLabelsAboveCell):
(WebCore::Frame::searchForLabelsBeforeElement):
(WebCore::matchLabelsAgainstString):
(WebCore::Frame::setTiledBackingStoreEnabled):
* page/Frame.h:
* page/FrameView.cpp:
(WebCore::FrameView::addEmbeddedObjectToUpdate):
(WebCore::FrameView::addSlowRepaintObject):
(WebCore::FrameView::addViewportConstrainedObject):
(WebCore::FrameView::addScrollableArea):
* page/FrameView.h:
* page/Page.cpp:
(WebCore::Page::Page):
* page/Page.h:
* page/PageConsole.h:
* page/PageThrottler.h:
* page/SecurityPolicy.cpp:
(WebCore::SecurityPolicy::addOriginAccessWhitelistEntry):
* page/animation/AnimationController.h:
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::PropertyWrapperVisitedAffectedColor::PropertyWrapperVisitedAffectedColor):
(WebCore::CSSPropertyAnimationWrapperMap::instance):
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* page/mac/PageMac.cpp:
(WebCore::Page::addSchedulePair):
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::applyContentSecurityPolicyFromString):

Source/WebKit/mac:
* WebView/WebHTMLRepresentation.mm:
(searchForLabelsBeforeElement): Pass a RegExp reference to Frame::searchForLabelsAboveCell().

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

6 years agoREGRESSION (r167530): ASSERT(m_selfTime <= m_totalTime) on tests that run after certa...
ap@apple.com [Mon, 21 Apr 2014 16:56:14 +0000 (16:56 +0000)]
REGRESSION (r167530): ASSERT(m_selfTime <= m_totalTime) on tests that run after certain Inspector tests
https://bugs.webkit.org/show_bug.cgi?id=131919

* TestExpectations: Skipping some Inspector tests, hopefully these are the ones that
cause trouble later.

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

6 years agoAdd HashSet::takeAny
darin@apple.com [Mon, 21 Apr 2014 15:52:27 +0000 (15:52 +0000)]
Add HashSet::takeAny
https://bugs.webkit.org/show_bug.cgi?id=131928

Reviewed by Benjamin Poulain.

Source/WebCore:
* dom/Document.cpp:
(WebCore::Document::takeAnyMediaCanStartListener): Use HashSet::takeAny.
* dom/ScriptExecutionContext.cpp:
(WebCore::takeAny): Deleted.
(WebCore::ScriptExecutionContext::~ScriptExecutionContext): Use HashSet::takeAny.

Source/WTF:
* wtf/HashSet.h: Added an overload of take that takes an iterator,
and used it to implement both the existing take and new takeAny functions.

Tools:
* TestWebKitAPI/Tests/WTF/HashSet.cpp: Added a test for takeAny.

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

6 years agoInline allocate Arguments objects in the DFG
mhahnenberg@apple.com [Mon, 21 Apr 2014 15:11:33 +0000 (15:11 +0000)]
Inline allocate Arguments objects in the DFG
https://bugs.webkit.org/show_bug.cgi?id=131897

Reviewed by Geoffrey Garen.

Many libraries/frameworks depend on the arguments object for overloaded API entry points.
This is the first step to making Arguments fast(er). We'll duplicate the logic in Arguments::create
for now and take the slow path for complicated cases like slow arguments, tearing off for strict mode, etc.

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::emitAllocateArguments):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::emitAllocateDestructibleObject):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* runtime/Arguments.h:
(JSC::Arguments::offsetOfActivation):
(JSC::Arguments::offsetOfOverrodeLength):
(JSC::Arguments::offsetOfIsStrictMode):
(JSC::Arguments::offsetOfRegisterArray):
(JSC::Arguments::offsetOfCallee):
(JSC::Arguments::allocationSize):

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

6 years agoiOS and non-iOS RemoteCommandListener::create() functions should use std::make_unique<>()
zandobersek@gmail.com [Mon, 21 Apr 2014 10:39:51 +0000 (10:39 +0000)]
iOS and non-iOS RemoteCommandListener::create() functions should use std::make_unique<>()
https://bugs.webkit.org/show_bug.cgi?id=131916

Reviewed by Darin Adler.

A follow-up to r167197. Make RemoteCommandListener ctor public and use std::make_unique<>()
in both versions of RemoteCommandListener::create() functions (iOS and non-iOS).

* platform/RemoteCommandListener.cpp:
(WebCore::RemoteCommandListener::create):
* platform/RemoteCommandListener.h:
(WebCore::RemoteCommandListener::RemoteCommandListener):
* platform/ios/RemoteCommandListenerIOS.mm:
(WebCore::RemoteCommandListener::create):

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

6 years agoMicro-optimize the way we hand NodeLists to JSC.
akling@apple.com [Mon, 21 Apr 2014 10:15:40 +0000 (10:15 +0000)]
Micro-optimize the way we hand NodeLists to JSC.
<https://webkit.org/b/131932>

Use HashMap::fastAdd() when returning cached node lists and collections.
10.9% progression on Bindings/get-elements-by-tag-name.html

Reviewed by Antti Koivisto.

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

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

6 years agoUnreviewed, rolling out r167584.
commit-queue@webkit.org [Mon, 21 Apr 2014 07:25:05 +0000 (07:25 +0000)]
Unreviewed, rolling out r167584.
https://bugs.webkit.org/show_bug.cgi?id=131929

Broke Objective-C bindings test (Requested by ap on #webkit).

Reverted changeset:

"Add Element.matches, the standard name for
webkitMatchesSelector"
https://bugs.webkit.org/show_bug.cgi?id=131922
http://trac.webkit.org/changeset/167584

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

6 years agoBlind Windows build fix. Hope I guessed the 64-bit mangled form right.
akling@apple.com [Mon, 21 Apr 2014 06:42:52 +0000 (06:42 +0000)]
Blind Windows build fix. Hope I guessed the 64-bit mangled form right.

* WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in:

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

6 years ago[Cocoa] Remove interfaces in the To Be Removed groups
mitz@apple.com [Mon, 21 Apr 2014 06:35:15 +0000 (06:35 +0000)]
[Cocoa] Remove interfaces in the To Be Removed groups
https://bugs.webkit.org/show_bug.cgi?id=131925

Reviewed by Darin Adler.

* Shared/API/Cocoa/WKRemoteObjectInterface.h: Removed.
* Shared/API/Cocoa/WKRemoteObjectInterface.mm: Removed.
* Shared/API/Cocoa/WKRemoteObjectRegistry.h: Removed.
* Shared/API/Cocoa/WKRemoteObjectRegistry.mm: Removed.
* UIProcess/API/Cocoa/WKProcessPool.mm:
* UIProcess/API/Cocoa/WKProcessPoolConfiguration.h: Removed.
* UIProcess/API/Cocoa/WKProcessPoolConfiguration.mm: Removed.
* UIProcess/API/Cocoa/WKProcessPoolConfigurationPrivate.h: Removed.
* UIProcess/API/Cocoa/WKProcessPoolToBeRemoved.mm: Removed.
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInBrowserContextControllerToBeRemoved.mm: Removed.
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h:

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

6 years agoCompile the :root pseudo class and fix a related issue with :nth-child()
benjamin@webkit.org [Mon, 21 Apr 2014 06:26:20 +0000 (06:26 +0000)]
Compile the :root pseudo class and fix a related issue with :nth-child()
https://bugs.webkit.org/show_bug.cgi?id=131926

Reviewed by Andreas Kling.

Source/WebCore:
Add the :root pseudo class. This is another trivial selector, we just need to compare
the element pointer with the documentElement.

I discovered some issues with :nth-child(n) through the layout tests for ":root".
When the pseudo class nth-child could match anything, no code was generated. That decision
was taken when generating the fragments.

The specification of :nth-child() has two tests: the parent test and the counter test.
Since some fragments would not generate any code for :nth-child(n), they would succeed on the root,
which is incorrect since the root should fail the parent test.

This was fixed by moving the filtering of non-counting :nth-child() after we generate the parent
check.
We still don't generate any counter test unless required.

Test: fast/selectors/nth-child-on-root.html

* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::addPseudoClassType):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChild):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsRoot):
* dom/Document.h:
(WebCore::Document::documentElementMemoryOffset):

LayoutTests:
Add more test coverage that would have caught the bug with :nth-child(n).

* fast/selectors/nth-child-on-root-expected.txt: Added.
* fast/selectors/nth-child-on-root.html: Added.

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

6 years agoAdd Element.matches, the standard name for webkitMatchesSelector
benjamin@webkit.org [Mon, 21 Apr 2014 06:08:05 +0000 (06:08 +0000)]
Add Element.matches, the standard name for webkitMatchesSelector
https://bugs.webkit.org/show_bug.cgi?id=131922

Reviewed by Andreas Kling.

Source/WebCore:
This patch just renames webkitMatchesSelector() to matches().

* bindings/scripts/CodeGeneratorObjC.pm:
(GenerateImplementation):
The Objective-C binding generator only supported ImplementedAs for getters and setters.
This adds support for the option so that Element.matches can be generated for Obj-C.

* dom/Element.cpp:
(WebCore::Element::matches):
(WebCore::Element::webkitMatchesSelector): Deleted.
* dom/Element.h:
* dom/Element.idl:
* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::buildArrayForMatchedRuleList):

LayoutTests:
Update the tests to verify both Element.matches and Element.webkitMatchesSelector

* fast/dom/SelectorAPI/attrname-case-insensitive-expected.txt:
* fast/dom/SelectorAPI/attrname-case-insensitive.html:
* fast/dom/SelectorAPI/attrname-case-sensitive-expected.txt:
* fast/dom/SelectorAPI/attrname-case-sensitive.xhtml:
* fast/dom/SelectorAPI/caseID-almost-strict-expected.txt:
* fast/dom/SelectorAPI/caseID-almost-strict.html:
* fast/dom/SelectorAPI/caseID-expected.txt:
* fast/dom/SelectorAPI/caseID-strict-expected.txt:
* fast/dom/SelectorAPI/caseID-strict.html:
* fast/dom/SelectorAPI/caseID.html:
* fast/dom/SelectorAPI/caseTag-expected.txt:
* fast/dom/SelectorAPI/caseTag.html:
* fast/dom/SelectorAPI/caseTagX-expected.txt:
* fast/dom/SelectorAPI/caseTagX.xhtml:
* fast/dom/SelectorAPI/detached-element-expected.txt:
* fast/dom/SelectorAPI/not-supported-namespace-in-selector-expected.txt:
* fast/dom/SelectorAPI/not-supported-namespace-in-selector.html:
* fast/dom/SelectorAPI/script-tests/detached-element.js:
* fast/dom/SelectorAPI/script-tests/undefined-null-stringify.js:
* fast/dom/SelectorAPI/script-tests/viewless-document.js:
* fast/dom/SelectorAPI/undefined-null-stringify-expected.txt:
* fast/dom/SelectorAPI/viewless-document-expected.txt:
* fast/forms/radio/radio-live-validation-style-expected.txt:
* fast/forms/radio/radio-live-validation-style.html:
* fast/harness/results.html:

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

6 years agoExpando properties on attribute nodes disappear
ap@apple.com [Mon, 21 Apr 2014 06:02:35 +0000 (06:02 +0000)]
Expando properties on attribute nodes disappear
https://bugs.webkit.org/show_bug.cgi?id=88045

* TestExpectations:
* platform/efl/TestExpectations:
* platform/mac/TestExpectations:
* platform/win/TestExpectations:
Consolidated test expectations, because all ports are equally affected. Some
platforms accidentally start to pass this test sometimes, but there is no real fix yet.

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

6 years agoSubpixel rendering: RenderLayer's size is set using enclosingRect() which can result...
zalan@apple.com [Mon, 21 Apr 2014 05:21:45 +0000 (05:21 +0000)]
Subpixel rendering: RenderLayer's size is set using enclosingRect() which can result in cruft.
https://bugs.webkit.org/show_bug.cgi?id=131468

Reviewed by Darin Adler.

Layers marked opaque may not paint edge pixels, when RenderLayer bounds are non-integral and
get device pixel snapped.
For details see this: https://trac.webkit.org/r159463

Source/WebCore:
Test: compositing/hidpi-non-simple-compositing-layer-with-fractional-size-and-background.html

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):

LayoutTests:
* compositing/hidpi-non-simple-compositing-layer-with-fractional-size-and-background-expected.html: Added.
* compositing/hidpi-non-simple-compositing-layer-with-fractional-size-and-background.html: Added.

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

6 years agoFix typo in change log
darin@apple.com [Mon, 21 Apr 2014 04:43:46 +0000 (04:43 +0000)]
Fix typo in change log

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

6 years agoSimple layout can get confused by coordinate overflow
darin@apple.com [Mon, 21 Apr 2014 04:40:11 +0000 (04:40 +0000)]
Simple layout can get confused by coordinate overflow
https://bugs.webkit.org/show_bug.cgi?id=131890
rdar://problem/15558510

Reviewed by Andreas Kling.

Source/WebCore:
Test: fast/css/simple-layout-overflow.html

* rendering/SimpleLineLayoutResolver.h:
(WebCore::SimpleLineLayout::RunResolver::rangeForRect):
If lastLine is smaller than firstList, just ignore it.

LayoutTests:
* fast/css/simple-layout-overflow-expected.txt: Added.
* fast/css/simple-layout-overflow.html: Added.

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

6 years agoScriptExecutionContext::stopActiveDOMObjects iterates a hash map that can change...
darin@apple.com [Mon, 21 Apr 2014 04:39:11 +0000 (04:39 +0000)]
ScriptExecutionContext::stopActiveDOMObjects iterates a hash map that can change during iteration (for multiple reasons, including GC)
https://bugs.webkit.org/show_bug.cgi?id=52719

Reviewed by Alexey Proskuryakov.

At least two specific ways this can happen:

1) XMLHttpRequest::stop can trigger a JavaScript garbage collection.
2) NotificationCenter::stop can delete the last references to notifications;
   those notifications are also active DOM objects.

Besides fixing the iteration in that function, did some other fixes for the
ScriptExecutionContext class, including some coding style changes. Many uses
of nullptr instead of 0, without listing each function separately below.

* Modules/webdatabase/DatabaseContext.cpp:
(WebCore::DatabaseContext::contextDestroyed): Call through to the base class
version of contextDestroyed rather than repeating what it does (with a large
comment that doesn't acknowledge the base class alread does it).
* Modules/webdatabase/DatabaseContext.h: Removed some unneeded includes.
Wrote out "private" explicitly for deriving from ActiveDOMObject. Made the
ActiveDOMObject function overrides private, and marked them override and final.

* dom/ActiveDOMObject.h: Updated comments. Replaced suspendIfNeededCalled with
assertSuspendIfNeededWasCalled, which has an empty inline version in the header.
Renamed m_suspendIfNeededCalled to m_suspendIfNeededWasCalled.

* dom/ActiveDOMObject.cpp:
(WebCore::ActiveDOMObject::ActiveDOMObject): Pass a reference instead of a pointer.
(WebCore::ActiveDOMObject::~ActiveDOMObject): Ditto.
(WebCore::ActiveDOMObject::suspendIfNeeded): Ditto.

* dom/ContextDestructionObserver.cpp:
(WebCore::ContextDestructionObserver::observeContext): Pass a reference instead of a pointer.

* dom/MessagePort.cpp:
(WebCore::MessagePort::MessagePort): Pass a reference instead of a pointer.
(WebCore::MessagePort::~MessagePort): Ditto.
(WebCore::MessagePort::disentangle): Ditto.

* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::ScriptExecutionContext): Updated flags used
for assertions so they are conditional and updated their names.
(WebCore::takeAny): Added. Helper function that we can consider for HashSet in
the future; makes loop below easier to read.
(WebCore::checkConsistency): Added. Assertions that were done multiple places below,
and should not be written over and over again.
(WebCore::ScriptExecutionContext::~ScriptExecutionContext): Changed to use C++11
for loops and the takeAny function above.
(WebCore::ScriptExecutionContext::dispatchMessagePortEvents): Ditto.
(WebCore::ScriptExecutionContext::createdMessagePort): Changed to take a reference
for clarity and so it doesn't have to do an assert the pointer is non-null.
(WebCore::ScriptExecutionContext::destroyedMessagePort): Ditto.
(WebCore::ScriptExecutionContext::canSuspendActiveDOMObjects): Changed to use
C++11 for loop and reworded comment and redid assertions.
(WebCore::ScriptExecutionContext::suspendActiveDOMObjects): Ditto.
(WebCore::ScriptExecutionContext::resumeActiveDOMObjects): Ditto.
(WebCore::ScriptExecutionContext::stopActiveDOMObjects): Changed to support
removal of an active DOM object during the stop function. Included new comments
to clarify what the rules are.
(WebCore::ScriptExecutionContext::suspendActiveDOMObjectIfNeeded): Changed to take
a reference for clarity and so it doesn't have to assert a pointer is non-null.
(WebCore::ScriptExecutionContext::didCreateActiveDOMObject): Ditto. Also changed to
use RELEASE_ASSERT instead of CRASH.
(WebCore::ScriptExecutionContext::willDestroyActiveDOMObject): Ditto.
(WebCore::ScriptExecutionContext::didCreateDestructionObserver): Ditto.
(WebCore::ScriptExecutionContext::willDestroyDestructionObserver): Ditto.
(WebCore::ScriptExecutionContext::closeMessagePorts): Moved the body of this
function into its one call site, ScriptExecutionContext::stopActiveDOMObjects,
since it's simple enough when written as a C++11 for loop.
(WebCore::ScriptExecutionContext::hasPendingActivity): Added. This function was
already exported for workers, and implementing it outside this class required
exposing the private HashSet members; more sensible to implement it here and
simply make it public in WorkerGlobalScope.

* dom/ScriptExecutionContext.h: Removed unnecessary includes and forward declarations.
Removed a long-ago-fixed FIXME. Changed various functions to take references instead of
pointers. Added a protected hasPendingActivity function, deleted the closeMessagePorts
function, deleted the ActiveDOMObjectsSet typedef, made the assertion flags be
!ASSERT_DISABLED only, and deleted the messagePorts and activeDOMObjects functions.

* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::hasPendingActivity): Deleted. This is now implemented
in the base class.

* workers/WorkerGlobalScope.h: Make hasPendingActivity function from the base class
public instead of declaring it in this class.

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

6 years ago[Mac] Unable to select 'Off' or 'Auto' from track menu when tracks consist of unsuppo...
bfulgham@apple.com [Mon, 21 Apr 2014 04:28:20 +0000 (04:28 +0000)]
[Mac] Unable to select 'Off' or 'Auto' from track menu when tracks consist of unsupported track types
https://bugs.webkit.org/show_bug.cgi?id=131908
<rdar://problem/15999882>

Reviewed by Eric Carlson.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setSelectedTextTrack): When the user selects 'Off', make sure the currently 'showing'
track is switched to 'disabled'.

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

6 years agoSpeed up jsStringWithCache() through WeakGCMap inlining.
akling@apple.com [Mon, 21 Apr 2014 04:19:07 +0000 (04:19 +0000)]
Speed up jsStringWithCache() through WeakGCMap inlining.
<https://webkit.org/b/131923>

Source/JavaScriptCore:
Always inline WeakGCMap::add() but move the slow garbage collecting
path out-of-line.

Reviewed by Darin Adler.

* runtime/WeakGCMap.h:
(JSC::WeakGCMap::add):
(JSC::WeakGCMap::gcMap):

Source/WebCore:
Inline the common path of WeakGCMap::add() in jsStringWithCache().
26% progression on Bindings/id-getter.html

Reviewed by Darin Adler.

* WebCore.exp.in:
* bindings/js/JSDOMBinding.h:
* bindings/js/JSDOMBinding.cpp:
(WebCore::jsStringWithCache):

    Move jsStringWithCache() out of line since we're now blowing up
    its size quite a bit.

Source/WTF:
Add HashMap::fastAdd(), which is the same as add() except we'll tell
the compiler to aggressively inline it.

Reviewed by Darin Adler.

* wtf/HashMap.h:
* wtf/HashTable.h:

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

6 years agoFixed a test timing out after r167572.
mitz@apple.com [Sun, 20 Apr 2014 22:45:38 +0000 (22:45 +0000)]
Fixed a test timing out after r167572.

* TestWebKitAPI/Tests/WebKit2Cocoa/Navigation.mm:
(-[NavigationDelegate webView:didFinishNavigation:]): Renamed from
-webView:didFinishLoadingNavigation:.

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

6 years agoFix the build after r167574
benjamin@webkit.org [Sun, 20 Apr 2014 21:53:01 +0000 (21:53 +0000)]
Fix the build after r167574

* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):

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

6 years agoCompile the pseudo class :target
benjamin@webkit.org [Sun, 20 Apr 2014 21:28:51 +0000 (21:28 +0000)]
Compile the pseudo class :target
https://bugs.webkit.org/show_bug.cgi?id=131904

Reviewed by Andreas Kling.

The pseudo class :target is trivial, it just compare the current element with
Document::cssTarget().

* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::addPseudoType):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
(WebCore::SelectorCompiler::getDocument):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeValueExactMatching):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsTarget):
* dom/Document.h:
(WebCore::Document::cssTargetMemoryOffset):

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

6 years ago[Cocoa] Crash when setting a bundle parameter to nil
mitz@apple.com [Sun, 20 Apr 2014 20:54:17 +0000 (20:54 +0000)]
[Cocoa] Crash when setting a bundle parameter to nil
https://bugs.webkit.org/show_bug.cgi?id=131917

Reviewed by Sam Weinig.

* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _setObject:forBundleParameter:]): If the object is nil, use
-[NSMutableDictionary removeObjectForKey:] rather than -setObject:forKey:.

* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessBundleParameters.mm:
(-[WKWebProcessBundleParameters setParameter:forKey:]): Ditto.

* WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
(WebKit::InjectedBundle::setBundleParameter): Unrelatedly, create m_bundleParameters if
needed, as it may have not been created on intialization if no bundle parameters were set
at the time.

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

6 years ago[Cocoa] Remove unused -webView:didFinishLoadingNavigation: delegate method
mitz@apple.com [Sun, 20 Apr 2014 20:53:39 +0000 (20:53 +0000)]
[Cocoa] Remove unused -webView:didFinishLoadingNavigation: delegate method
https://bugs.webkit.org/show_bug.cgi?id=131914

Reviewed by Sam Weinig.

* UIProcess/Cocoa/NavigationState.h: Removed flag from m_navigationDelegateMethods struct.
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::setNavigationDelegate): Removed check for whether the method is
implemented.
(WebKit::NavigationState::LoaderClient::didFinishLoadForFrame): Stopped calling the method
if implemented.

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

6 years agoRename the CSSSelector PseudoType to PseudoClassType
benjamin@webkit.org [Sun, 20 Apr 2014 20:43:35 +0000 (20:43 +0000)]
Rename the CSSSelector PseudoType to PseudoClassType
https://bugs.webkit.org/show_bug.cgi?id=131907

Reviewed by Andreas Kling.

Pseudo Elements and Page Pseudo Classes have been moved out of PseudoType in previous patches.
The remaining values in the PseudoType enumeration are the pseudo classes.

This patch is the final clean up, PseudoType is renamed to PseudoClassType.

* css/CSSGrammar.y.in:
* css/CSSParserValues.cpp:
(WebCore::CSSParserSelector::parsePseudoClassAndCompatibilityElementSelector):
* css/CSSParserValues.h:
(WebCore::CSSParserSelector::pseudoClassType):
(WebCore::CSSParserSelector::pseudoType): Deleted.
* css/CSSSelector.cpp:
(WebCore::CSSSelector::specificityForOneSelector):
(WebCore::appendPseudoClassFunctionTail):
(WebCore::CSSSelector::selectorText):
* css/CSSSelector.h:
(WebCore::CSSSelector::pseudoClassType):
(WebCore::CSSSelector::pseudoElementType):
(WebCore::CSSSelector::pagePseudoClassType):
(WebCore::pseudoClassIsRelativeToSiblings):
(WebCore::CSSSelector::isSiblingSelector):
(WebCore::CSSSelector::CSSSelector):
(WebCore::CSSSelector::pseudoType): Deleted.
* css/RuleSet.cpp:
(WebCore::RuleSet::findBestRuleSetAndAdd):
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOne):
(WebCore::SelectorChecker::checkScrollbarPseudoClass):
(WebCore::SelectorChecker::determineLinkMatchType):
(WebCore::SelectorChecker::matchesFocusPseudoClass):
* css/SelectorChecker.h:
(WebCore::SelectorChecker::isCommonPseudoClassSelector):
* css/SelectorCheckerFastPath.cpp:
(WebCore::SelectorCheckerFastPath::commonPseudoClassSelectorMatches):
* css/SelectorPseudoClassAndCompatibilityElementMap.in:
* css/SelectorPseudoTypeMap.h:
* css/StyleResolver.cpp:
(WebCore::StyleResolver::styleForElement):
* css/makeSelectorPseudoClassAndCompatibilityElementMap.py:
(enumerablePseudoType):
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::addPseudoClassType):
(WebCore::SelectorCompiler::SelectorCodeGenerator::SelectorCodeGenerator):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
(WebCore::SelectorCompiler::addPseudoType): Deleted.
* inspector/InspectorCSSAgent.cpp:
(WebCore::computePseudoClassMask):
(WebCore::InspectorCSSAgent::forcePseudoState):
* inspector/InspectorCSSAgent.h:
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::forcePseudoStateImpl):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::forcePseudoState):

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

6 years agobmalloc: Segregate pages by objects size
ggaren@apple.com [Sun, 20 Apr 2014 19:33:14 +0000 (19:33 +0000)]
bmalloc: Segregate pages by objects size
https://bugs.webkit.org/show_bug.cgi?id=131909

Reviewed by Andreas Kling.

2% reduction in memory-at-end on the Membuster memory_warning benchmarks.

* bmalloc/Allocator.cpp:
(bmalloc::Allocator::allocateSlowCase):
* bmalloc/Allocator.h:
(bmalloc::Allocator::allocateFastCase):
(bmalloc::Allocator::smallAllocatorFor): Use the new shared helper
function for size class calculation.

* bmalloc/Deallocator.cpp:
(bmalloc::Deallocator::Deallocator):
(bmalloc::Deallocator::scavenge):
(bmalloc::Deallocator::deallocateSmallLine):
(bmalloc::Deallocator::allocateSmallLine):
* bmalloc/Deallocator.h: Keep a cache for every size class, since the
cache can't be shared anymore.

* bmalloc/Heap.cpp:
(bmalloc::Heap::allocateSmallLineSlowCase):
* bmalloc/Heap.h:
(bmalloc::Heap::deallocateSmallLine): Ditto.

(bmalloc::Heap::allocateSmallLine): Check size class in addition to
page refcount when allocating a line because we might have deallocated
the page and the recycled it for another size class.

(bmalloc::Heap::deallocateMediumLine):
(bmalloc::Heap::allocateMediumLine):
* bmalloc/Line.h:
(bmalloc::Line::refCount):
* bmalloc/Page.h:
(bmalloc::Page::refCount):
(bmalloc::Page::smallSizeClass):
(bmalloc::Page::setSmallSizeClass):
(bmalloc::Page<Traits>::refCount): Deleted.
* bmalloc/Sizes.h:
(bmalloc::Sizes::smallSizeClassFor): New shared API for computing
an index into an array from a size.

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

6 years agoCrashes in HTMLFormElement::submit.
ap@apple.com [Sun, 20 Apr 2014 19:02:13 +0000 (19:02 +0000)]
Crashes in HTMLFormElement::submit.
https://bugs.webkit.org/show_bug.cgi?id=131910
<rdar://problem/15661790>

Source/WebCore:
Based on a patch by Kent Tamura.

Reviewed by Anders Carlsson.

Tests: fast/forms/form-submission-crash-2.html
       fast/forms/form-submission-crash.html

Code that executes arbitrary JS needs to protect objects that it uses afterwards.

* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::prepareForSubmission):
(WebCore::HTMLFormElement::submit):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::submitForm):

LayoutTests:
Reviewed by Anders Carlsson.

* fast/forms/form-submission-crash-2-expected.txt: Added.
* fast/forms/form-submission-crash-2.html: Added.
* fast/forms/form-submission-crash-expected.txt: Added.
* fast/forms/form-submission-crash.html: Added.

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

6 years agoText bounding box computation for simple line layout is wrong
antti@apple.com [Sun, 20 Apr 2014 17:43:54 +0000 (17:43 +0000)]
Text bounding box computation for simple line layout is wrong
https://bugs.webkit.org/show_bug.cgi?id=131912

Reviewed by Andreas Kling.

Source/WebCore:

Top-left is currently the first line top-left which is not always correct.

* WebCore.exp.in:
* rendering/RenderText.cpp:
(WebCore::RenderText::firstRunLocation):
(WebCore::RenderText::firstRunOrigin): Deleted.
(WebCore::RenderText::firstRunX): Deleted.
(WebCore::RenderText::firstRunY): Deleted.

    Keep just one accessor and rename it.
    Encapsulate the line box and simple line versions.

* rendering/RenderText.h:
* rendering/RenderTextLineBoxes.cpp:
(WebCore::RenderTextLineBoxes::firstRunLocation):

    Line box version.

* rendering/RenderTextLineBoxes.h:
* rendering/RenderTreeAsText.cpp:

    Simplify RenderText dumping.

(WebCore::RenderTreeAsText::writeRenderObject):
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::computeTextBoundingBox):

    Return the correct x position.

(WebCore::SimpleLineLayout::computeTextFirstRunLocation):

    Simple line version.

* rendering/SimpleLineLayoutFunctions.h:
* rendering/svg/SVGRenderTreeAsText.cpp:
(WebCore::writeSVGInlineText):

LayoutTests:

Some dumped RenderText sizes change in table related test. These are progressions,
the new results match the contained lines. There are no visual changes.

* platform/mac/fast/table/dynamic-caption-add-remove-before-child-expected.txt:
* platform/mac/fast/table/multiple-captions-display-expected.txt:
* platform/mac/tables/mozilla/marvin/body_col-expected.txt:
* platform/mac/tables/mozilla/marvin/x_th_valign_baseline-expected.txt:
* platform/mac/tables/mozilla/other/body_col-expected.txt:
* platform/mac/tables/mozilla_expected_failures/bugs/bug10140-expected.txt:
* platform/mac/tables/mozilla_expected_failures/bugs/bug10216-expected.txt:
* platform/mac/tables/mozilla_expected_failures/core/captions3-expected.txt:
* platform/mac/tables/mozilla_expected_failures/other/test4-expected.txt:

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

6 years agoUnreviewed, rolling out r167510.
commit-queue@webkit.org [Sun, 20 Apr 2014 17:40:40 +0000 (17:40 +0000)]
Unreviewed, rolling out r167510.
https://bugs.webkit.org/show_bug.cgi?id=131915

broke GTK Debug bot (Requested by philn on #webkit).

Reverted changeset:

"[GTK] Add llvmpipe (Mesa) to the JHBuild moduleset and force
it when running layout tests"
https://bugs.webkit.org/show_bug.cgi?id=131472
http://trac.webkit.org/changeset/167510

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

6 years agoJavaScriptCore: ARM build fix after r167094.
ossy@webkit.org [Sun, 20 Apr 2014 13:58:25 +0000 (13:58 +0000)]
JavaScriptCore: ARM build fix after r167094.
https://bugs.webkit.org/show_bug.cgi?id=131612

Patch by László Langó <llango.u-szeged@partner.samsung.com> on 2014-04-20
Reviewed by Michael Saboff.

After r167094 there are many build errors on ARM like these:

    /tmp/ccgtHRno.s:370: Error: invalid constant (425a) after fixup
    /tmp/ccgtHRno.s:374: Error: invalid constant (426e) after fixup
    /tmp/ccgtHRno.s:378: Error: invalid constant (4282) after fixup
    /tmp/ccgtHRno.s:382: Error: invalid constant (4296) after fixup

Problem is caused by the wrong generated assembly like:
    "\tmov r2, (" LOCAL_LABEL_STRING(llint_op_strcat) " - " LOCAL_LABEL_STRING(relativePCBase) ")\n" // /home/webkit/WebKit/Source/JavaScriptCore/llint/LowLevelInterpreter.asm:741

`mov` can only move 8 bit immediate, but not every constant fit into 8 bit. Clang converts
the mov to a single movw or a movw and a movt, depending on the immediate, but binutils doesn't.
Add a new ARM specific offline assembler instruction (`mvlbl`) for the following llint_entry
use case: move rn, (label1-label2) which is translated to movw and movt.

* llint/LowLevelInterpreter.asm:
* offlineasm/arm.rb:
* offlineasm/instructions.rb:

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

6 years ago[ARM] Unreviewed build fix after r167336.
ossy@webkit.org [Sun, 20 Apr 2014 13:46:46 +0000 (13:46 +0000)]
[ARM] Unreviewed build fix after r167336.

* assembler/MacroAssemblerARM.h:
(JSC::MacroAssemblerARM::branchAdd32):

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

6 years agoUnreviewed, rolling out r167501.
commit-queue@webkit.org [Sun, 20 Apr 2014 11:45:32 +0000 (11:45 +0000)]
Unreviewed, rolling out r167501.
https://bugs.webkit.org/show_bug.cgi?id=131913

It broke DYEBench (Requested by mhahnenberg on #webkit).

Reverted changeset:

"Deleting properties poisons objects"
https://bugs.webkit.org/show_bug.cgi?id=131551
http://trac.webkit.org/changeset/167501

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

6 years agoIt should be OK to store new fields into objects that have no prototypes
fpizlo@apple.com [Sun, 20 Apr 2014 04:42:42 +0000 (04:42 +0000)]
It should be OK to store new fields into objects that have no prototypes
https://bugs.webkit.org/show_bug.cgi?id=131905

Reviewed by Mark Hahnenberg.

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::emitPrototypeChecks):
* tests/stress/put-by-id-transition-null-prototype.js: Added.
(foo):

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

6 years agoSubpixel rendering: RenderLayer's clipping should snap to device pixel boundaries.
zalan@apple.com [Sun, 20 Apr 2014 03:38:09 +0000 (03:38 +0000)]
Subpixel rendering: RenderLayer's clipping should snap to device pixel boundaries.
https://bugs.webkit.org/show_bug.cgi?id=131466

Reviewed by Simon Fraser.

Fractional pixel clipping can produce cruft on RenderLayers. Since RenderLayer
sizing and painting are snapped, painting clip rect needs to be snapped the same way.

Source/WebCore:
Test: fast/clip/clip-when-rect-has-fractional-pixel-value.html

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

LayoutTests:
* fast/clip/clip-when-rect-has-fractional-pixel-value-expected.html: Added.
* fast/clip/clip-when-rect-has-fractional-pixel-value.html: Added.

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

6 years agoRevert unintended workspace change in my last commit.
bfulgham@apple.com [Sun, 20 Apr 2014 03:10:38 +0000 (03:10 +0000)]
Revert unintended workspace change in my last commit.

* WebKit.xcworkspace/xcshareddata/xcschemes/All Source (target WebProcess).xcscheme: Set the
Scheme type back to Debug.

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

6 years agoLatched scrolling may interact badly with custom programmatic scrolling
bfulgham@apple.com [Sun, 20 Apr 2014 02:32:48 +0000 (02:32 +0000)]
Latched scrolling may interact badly with custom programmatic scrolling
https://bugs.webkit.org/show_bug.cgi?id=131869
<rdar://problem/16249557>

Reviewed by Darin Adler.

* dom/Element.cpp:
(WebCore::Element::setScrollLeft): Mark scrollable area as having
been scrolled programmatically.
(WebCore::Element::setScrollTop): Ditto.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleWheelEvent): Check for programmatic scroll, and
clear latched state if the handler manually scrolled. Clear programmatic
scroll state at the end of event handling.
(WebCore::EventHandler::clearLatchedState): Refactored code.
* page/EventHandler.h:
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::platformPrepareForWheelEvents): Check
if scrollable area was scrolled programmatically. If it was, do
not honor latching behavior.
* platform/ScrollableArea.cpp:
(WebCore::ScrollableArea::ScrollableArea): Initialize new member.
* platform/ScrollableArea.h:
(WebCore::ScrollableArea::isScrolledProgrammatically): Added.
(WebCore::ScrollableArea::setScrolledProgrammatically): Added.

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

6 years agoAX: grid rows are not recognized do to lack of explicit role="row", role="gridcell"
cfleizach@apple.com [Sun, 20 Apr 2014 01:38:48 +0000 (01:38 +0000)]
AX: grid rows are not recognized do to lack of explicit role="row", role="gridcell"
https://bugs.webkit.org/show_bug.cgi?id=131819

Reviewed by Darin Adler.

Source/WebCore:
Test: accessibility/table-with-missing-aria-role-rows.html

If a table is using role="grid", and it has <tr> elements that do not have
role="row", we should still treat them as row elements.

* accessibility/AccessibilityARIAGrid.cpp:
(WebCore::AccessibilityARIAGrid::addTableCellChild):

LayoutTests:
* accessibility/table-with-missing-aria-role-rows-expected.txt: Added.
* accessibility/table-with-missing-aria-role-rows.html: Added.

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

6 years agoAX: Malformed tables exposing incorrect col and colSpans
cfleizach@apple.com [Sun, 20 Apr 2014 01:25:28 +0000 (01:25 +0000)]
AX: Malformed tables exposing incorrect col and colSpans
https://bugs.webkit.org/show_bug.cgi?id=131796

Reviewed by Darin Adler.

Source/WebCore:
Test: accessibility/table-incorrect-colspan-cell.html

When a developer has specified malformed colspans, accessibility is reporting those values instead of the effective column information.

* accessibility/AccessibilityTableCell.cpp:
(WebCore::AccessibilityTableCell::columnIndexRange):

LayoutTests:
* accessibility/table-incorrect-colspan-cell-expected.txt: Added.
* accessibility/table-incorrect-colspan-cell.html: Added.

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

6 years agoMake the CSS JIT compile for ARM64
benjamin@webkit.org [Sun, 20 Apr 2014 01:22:06 +0000 (01:22 +0000)]
Make the CSS JIT compile for ARM64
https://bugs.webkit.org/show_bug.cgi?id=131834

Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-04-19
Reviewed by Gavin Barraclough.

Source/JavaScriptCore:
Extend the ARM64 MacroAssembler to support the code generation required by
the CSS JIT.

* assembler/MacroAssembler.h:
* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::addPtrNoFlags):
(JSC::MacroAssemblerARM64::or32):
(JSC::MacroAssemblerARM64::branchPtr):
(JSC::MacroAssemblerARM64::test32):
(JSC::MacroAssemblerARM64::branch):
* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::test32):

Source/WebCore:
Add the CPU specific code required to compile SelectorCompiler on ARM64.
The code is absolutely non-functional, it would crash immediately, but it compiles.

* cssjit/FunctionCall.h:
(WebCore::FunctionCall::FunctionCall):
(WebCore::FunctionCall::callAndBranchOnCondition):
* cssjit/RegisterAllocator.h:
What am I supposed to do with all those registers? There are so many of them :)
The array calleeSavedRegisters is defined for compatibility but it cannot be reached at the moment.

(WebCore::RegisterAllocator::isValidRegister):
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorCodeGenerator::modulo):
Implement modulo by doing dividend - (divisor * int(dividend/divisor)).

* cssjit/StackAllocator.h:
StackAllocator will need a small redesign to handle the 16 bytes alligned stack of
ARM64.
The code has been modified to build but it is pretty useless.

(WebCore::StackAllocator::allocateUninitialized):
(WebCore::StackAllocator::push):
(WebCore::StackAllocator::pop):
(WebCore::StackAllocator::popAndDiscard):
(WebCore::StackAllocator::popAndDiscardUpTo):
(WebCore::StackAllocator::alignStackPreFunctionCall):
(WebCore::StackAllocator::unalignStackPostFunctionCall):

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

6 years agoPlug-in process crashes if NP_Initialize returns an error the second time it's called
andersca@apple.com [Sun, 20 Apr 2014 00:54:04 +0000 (00:54 +0000)]
Plug-in process crashes if NP_Initialize returns an error the second time it's called
https://bugs.webkit.org/show_bug.cgi?id=131903
<rdar://problem/14355462>

Reviewed by Sam Weinig.

* Shared/Plugins/Netscape/NetscapePluginModule.cpp:
(WebKit::NetscapePluginModule::decrementLoadCount):
Don't try to unload the plug-in if it hasn't been initialized.

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

6 years ago [Mac] Unreviewed gardening.
zalan@apple.com [Sun, 20 Apr 2014 00:28:30 +0000 (00:28 +0000)]
   [Mac] Unreviewed gardening.

repaintRectsAsText() reports wrong subpixel dirty rects on hidpi.

* platform/mac/TestExpectations:

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

6 years agobmalloc: Improved alignment in LargeChunk
ggaren@apple.com [Sat, 19 Apr 2014 23:02:09 +0000 (23:02 +0000)]
bmalloc: Improved alignment in LargeChunk
https://bugs.webkit.org/show_bug.cgi?id=131895

Reviewed by Andreas Kling.

* bmalloc/Chunk.h:
* bmalloc/LargeChunk.h: Align to vmPageSize just like Chunk does.
Technically, the previous alignment was harmless, but I would prefer,
dear reader, not to have to explain the interlocking set of
circumstances that made it so.

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

6 years ago[UI-side compositing] Implement blend modes
simon.fraser@apple.com [Sat, 19 Apr 2014 22:26:59 +0000 (22:26 +0000)]
[UI-side compositing] Implement blend modes
https://bugs.webkit.org/show_bug.cgi?id=131891
<rdar://problem/16490085>

Reviewed by Tim Horton.

Implement blend modes with UI-side compositing.

PlatformCALayer::setBlendMode() becomes pure virtual, and overridden in
PlatformCALayerMac and PlatformCALayerRemote.
PlatformCAFilters::setBlendingFiltersOnLayer() now takes a raw platform
layer, so it can be called from the UI process on a CALayer*.

Source/WebCore:
Fix an issue with GraphicsLayerCA::LayerChange flags. 1 << 31 shifts
a signed integer, so it ended up setting all the high bits in m_uncommittedChanges,
causing us to push blend modes to the UI process for every layer. Fix by shifting
an unsigned long long (1LLU << 31). This should also fix a build warning on Windows.

* WebCore.exp.in:
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/ca/PlatformCAFilters.h:
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/mac/PlatformCAFiltersMac.mm:
(PlatformCAFilters::setBlendingFiltersOnLayer):
* platform/graphics/ca/mac/PlatformCALayerMac.h:
* platform/graphics/ca/mac/PlatformCALayerMac.mm:
(PlatformCALayerMac::setFilters):
(PlatformCALayerMac::setBlendMode):
(PlatformCALayer::setBlendMode): Deleted.

Source/WebKit2:
Add BlendMode to LayerProperties, and initialize, encode and decode it,
as well as adding dumping support for blend modes.

* Shared/mac/RemoteLayerTreePropertyApplier.mm:
(WebKit::applyPropertiesToLayer):
* Shared/mac/RemoteLayerTreeTransaction.h:
* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
(WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
(WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
(WebKit::RemoteLayerTreeTextStream::operator<<):
(WebKit::dumpChangedLayers):
* WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::setBlendMode):
* WebProcess/WebPage/mac/PlatformCALayerRemote.h:

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

6 years agoFix leak of UIScreenEdgePanGestureRecognizer in WKSwipeTransitionController
commit-queue@webkit.org [Sat, 19 Apr 2014 22:16:26 +0000 (22:16 +0000)]
Fix leak of UIScreenEdgePanGestureRecognizer in WKSwipeTransitionController
https://bugs.webkit.org/show_bug.cgi?id=131877

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

* UIProcess/ios/ViewGestureControllerIOS.mm:
(-[WKSwipeTransitionController gestureRecognizerForInteractiveTransition:WithTarget:action:]):

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

6 years agoFix AVPlayerController leak on pages with video
commit-queue@webkit.org [Sat, 19 Apr 2014 22:12:41 +0000 (22:12 +0000)]
Fix AVPlayerController leak on pages with video
https://bugs.webkit.org/show_bug.cgi?id=131878

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2014-04-19
Reviewed by Eric Carlson.

* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(-[WebAVPlayerController init]):
Assigning to the retain property will increment the count,
so balance the alloc with an autorelease.

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

6 years agoTwo little shortcuts to the JSType.
akling@apple.com [Sat, 19 Apr 2014 22:09:51 +0000 (22:09 +0000)]
Two little shortcuts to the JSType.
<https://webkit.org/b/131896>

Tweak two sites that take the long road through JSCell::structure()->typeInfo()
to look at data that's already in JSCell::type().

Reviewed by Darin Adler.

* runtime/NameInstance.h:
(JSC::isName):
* runtime/NumberPrototype.cpp:
(JSC::toThisNumber):

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

6 years agoDon’t install a source file inside WebProcess.app.
mitz@apple.com [Sat, 19 Apr 2014 21:42:40 +0000 (21:42 +0000)]
Don’t install a source file inside WebProcess.app.

* WebKit2.xcodeproj/project.pbxproj: Removed ViewUpdateDispatcher.messages.in from
WebProcess’s Copy Bundle Resources build phase.

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

6 years agoMake it easier to check if an integer sum would overflow
fpizlo@apple.com [Sat, 19 Apr 2014 21:13:46 +0000 (21:13 +0000)]
Make it easier to check if an integer sum would overflow
https://bugs.webkit.org/show_bug.cgi?id=131900

Reviewed by Darin Adler.

Source/JavaScriptCore:
* dfg/DFGOperations.cpp:
* runtime/Operations.h:
(JSC::jsString):

Source/WTF:
* wtf/CheckedArithmetic.h:
(WTF::checkedSum):
(WTF::sumOverflows):

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

6 years ago[Mac] WebView adjusts the cursor even when another window is in front
darin@apple.com [Sat, 19 Apr 2014 21:11:06 +0000 (21:11 +0000)]
[Mac] WebView adjusts the cursor even when another window is in front
https://bugs.webkit.org/show_bug.cgi?id=131898
rdar://problem/14619911

Reviewed by Dan Bernstein.

Source/WebKit/mac:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::setCursor): Added a check that the window is under the cursor
and do nothing if it's not.

Source/WebKit2:
* UIProcess/API/mac/WKView.mm:
(-[WKView _setCursor:]): Deleted. Moved the code all into PageClientImpl, since none of it
interacts with anything special about a WKView.

* UIProcess/API/mac/WKViewInternal.h: Deleted the _setCursor: method.

* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::setCursor): Added a check that the window is under the cursor
and do nothing if it's not.

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

6 years ago2014-04-19 Geoffrey Garen <ggaren@apple.com>
ggaren@apple.com [Sat, 19 Apr 2014 20:41:16 +0000 (20:41 +0000)]
2014-04-19  Geoffrey Garen  <ggaren@apple.com>

        Rolled out r167502 because it caused a crash on the facebook benchmark.

        Unreviewed.

            bmalloc: Added an XSmall line size
            https://bugs.webkit.org/show_bug.cgi?id=131851

            Reviewed by Sam Weinig.

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

6 years agoSlap ALWAYS_INLINE on Element attribute lookup things.
akling@apple.com [Sat, 19 Apr 2014 20:40:39 +0000 (20:40 +0000)]
Slap ALWAYS_INLINE on Element attribute lookup things.
<https://webkit.org/b/131892>

Most of the "inline" helpers for setting/getting attributes were not
actually getting inlined by the compiler, so let's make that happen.

Reviewed by Geoffrey Garen.

* dom/Element.cpp:
(WebCore::Element::synchronizeAttribute):
* dom/ElementData.h:
(WebCore::ElementData::findAttributeByName):
(WebCore::ElementData::findAttributeIndexByName):

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

6 years agoAddress some feedback on https://bugs.webkit.org/show_bug.cgi?id=130684.
fpizlo@apple.com [Sat, 19 Apr 2014 20:36:58 +0000 (20:36 +0000)]
Address some feedback on https://bugs.webkit.org/show_bug.cgi?id=130684.

* dfg/DFGOperations.cpp:
* runtime/JSString.h:
(JSC::JSRopeString::RopeBuilder::append):

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

6 years agoUse XPC services in the iOS Simulator, but not in Mountain Lion
mitz@apple.com [Sat, 19 Apr 2014 20:10:49 +0000 (20:10 +0000)]
Use XPC services in the iOS Simulator, but not in Mountain Lion
https://bugs.webkit.org/show_bug.cgi?id=131894

Reviewed by Anders Carlsson.

* Configurations/NetworkService.Development.xcconfig: Defined INFOPLIST_FILE for the
Simulator.
* Configurations/NetworkService.xcconfig: Ditto.
* Configurations/WebContentService.Development.xcconfig: Ditto.
* Configurations/WebContentService.xcconfig: Ditto.
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::systemDirectoryPath): Added this helper function that returns a slash-terminated
path to the System directory in the current runtime.
(WebKit::ProcessLauncher::launchProcess): Changed to use the above function to tell whether
a development version of WebKit2 is being used.
* WebKit2Prefix.h: Set WTF_USE_XPC_SERVICES to 1 when targeting the iOS Simulator, but not
when targeting Mountain Lion.

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

6 years agoTelephone number detection should respect its setting consistently
darin@apple.com [Sat, 19 Apr 2014 19:47:27 +0000 (19:47 +0000)]
Telephone number detection should respect its setting consistently
https://bugs.webkit.org/show_bug.cgi?id=131893
rdar://problem/16597639

Reviewed by Tim Horton.

* editing/Editor.cpp:
(WebCore::Editor::respondToChangedSelection): Only start the timer
if shouldDetectTelephoneNumbers returns true.
(WebCore::Editor::shouldDetectTelephoneNumbers): Added. Calls both
isTelephoneNumberParsingEnabled and TelephoneNumberDetector::isSupported.
(WebCore::Editor::scanSelectionForTelephoneNumbers): Use
shouldDetectTelephoneNumbers.
(WebCore::Editor::clearDataDetectedTelephoneNumbers): Use document()
instead of m_frame.document().

* editing/Editor.h: Added declaration of shouldDetectTelephoneNumbers.

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

6 years ago[CSS Regions] Harden the layout in case there are no regions
darin@apple.com [Sat, 19 Apr 2014 18:57:46 +0000 (18:57 +0000)]
[CSS Regions] Harden the layout in case there are no regions
https://bugs.webkit.org/show_bug.cgi?id=131517

Patch by Andrei Bucur <abucur@adobe.com> on 2014-04-19
Reviewed by Mihnea Ovidenie.

Source/WebCore:
The patch fixes the cases when the content of a flow thread is not
properly invalidated when all the regions of its chain are removed.

Test: fast/regions/simplified-layout-no-regions.html

* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::logicalWidthChangedInRegionsForBlock):
* rendering/RenderRegion.cpp:
(WebCore::RenderRegion::ensureOverflowForBox):

LayoutTests:
Add a test that verifies the content of a flow thread is updated when all
the regions are removed.

* fast/regions/simplified-layout-no-regions-expected.txt: Added.
* fast/regions/simplified-layout-no-regions.html: Added.

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

6 years agobmalloc: Mutex should be harder to use wrong
ggaren@apple.com [Sat, 19 Apr 2014 18:36:56 +0000 (18:36 +0000)]
bmalloc: Mutex should be harder to use wrong
https://bugs.webkit.org/show_bug.cgi?id=131879

Reviewed by Andreas Kling.

Mutex now has a proper constructor, so you can't deadlock by forgetting
to initialize it.

* bmalloc.xcodeproj/project.pbxproj:
* bmalloc/Allocator.cpp:
(bmalloc::Allocator::processXSmallAllocatorLog):
(bmalloc::Allocator::processSmallAllocatorLog):
(bmalloc::Allocator::processMediumAllocatorLog):
(bmalloc::Allocator::allocateLarge):
(bmalloc::Allocator::allocateXLarge): Global replace Mutex => StaticMutex,
since the Heap mutex is a static.

* bmalloc/AsyncTask.h:
(bmalloc::Function>::AsyncTask): Use Mutex, since we're not static. No
need for explicit initialization anymore.

* bmalloc/Deallocator.cpp:
(bmalloc::Deallocator::scavenge):
(bmalloc::Deallocator::deallocateLarge):
(bmalloc::Deallocator::deallocateXLarge):
(bmalloc::Deallocator::processObjectLog):
(bmalloc::Deallocator::deallocateSmallLine):
(bmalloc::Deallocator::deallocateXSmallLine):
(bmalloc::Deallocator::allocateSmallLine):
(bmalloc::Deallocator::allocateXSmallLine):
(bmalloc::Deallocator::deallocateMediumLine):
(bmalloc::Deallocator::allocateMediumLine):
* bmalloc/Deallocator.h:
* bmalloc/Heap.cpp:
(bmalloc::sleep):
(bmalloc::Heap::Heap):
(bmalloc::Heap::concurrentScavenge):
(bmalloc::Heap::scavenge):
(bmalloc::Heap::scavengeSmallPages):
(bmalloc::Heap::scavengeXSmallPages):
(bmalloc::Heap::scavengeMediumPages):
(bmalloc::Heap::scavengeLargeRanges):
(bmalloc::Heap::allocateXSmallLineSlowCase):
(bmalloc::Heap::allocateSmallLineSlowCase):
(bmalloc::Heap::allocateMediumLineSlowCase):
(bmalloc::Heap::allocateXLarge):
(bmalloc::Heap::deallocateXLarge):
(bmalloc::Heap::allocateLarge):
(bmalloc::Heap::deallocateLarge):
* bmalloc/Heap.h:
(bmalloc::Heap::deallocateXSmallLine):
(bmalloc::Heap::allocateXSmallLine):
(bmalloc::Heap::deallocateSmallLine):
(bmalloc::Heap::allocateSmallLine):
(bmalloc::Heap::deallocateMediumLine):
(bmalloc::Heap::allocateMediumLine):
* bmalloc/Line.h:
(bmalloc::Line<Traits>::deref):
* bmalloc/Mutex.cpp: Removed.
* bmalloc/Mutex.h:
(bmalloc::Mutex::Mutex):
(bmalloc::Mutex::init): Deleted.
(bmalloc::Mutex::try_lock): Deleted.
(bmalloc::Mutex::lock): Deleted.
(bmalloc::Mutex::unlock): Deleted.
* bmalloc/Page.h:
(bmalloc::Page<Traits>::ref):
(bmalloc::Page<Traits>::deref):
(bmalloc::Page<Traits>::refCount):
* bmalloc/PerProcess.h:
(bmalloc::PerProcess::mutex):
(bmalloc::PerProcess<T>::getSlowCase):
* bmalloc/StaticMutex.cpp: Added.
(bmalloc::StaticMutex::lockSlowCase):
* bmalloc/StaticMutex.h: Added.
(bmalloc::StaticMutex::init):
(bmalloc::StaticMutex::try_lock):
(bmalloc::StaticMutex::lock):
(bmalloc::StaticMutex::unlock):
* bmalloc/VMHeap.h:
(bmalloc::VMHeap::deallocateXSmallPage):
(bmalloc::VMHeap::deallocateSmallPage):
(bmalloc::VMHeap::deallocateMediumPage):
(bmalloc::VMHeap::deallocateLargeRange):
* bmalloc/bmalloc.h:
(bmalloc::api::scavenge): Global replace Mutex => StaticMutex,
since the Heap mutex is a static.

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

6 years agoCleared executable bits on many .html and .txt files.
darin@apple.com [Sat, 19 Apr 2014 18:12:39 +0000 (18:12 +0000)]
Cleared executable bits on many .html and .txt files.

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

6 years agohttps://bugs.webkit.org/show_bug.cgi?id=131594
zalan@apple.com [Sat, 19 Apr 2014 17:48:08 +0000 (17:48 +0000)]
https://bugs.webkit.org/show_bug.cgi?id=131594
Subpixel rendering: WK1: Wrong repaint rect is calculated when layer has non-compositing transform.

Reviewed by Simon Fraser.

We need to snap the repaint rect for transformed object the same way when we paint them.

Test: fast/repaint/hidpi-wrong-repaint-rect-when-parent-has-noncompositing-transform.html

Source/WebCore:
* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeRectForRepaint):

LayoutTests:
* fast/repaint/hidpi-wrong-repaint-rect-when-parent-has-noncompositing-transform-expected.txt: Added.
* fast/repaint/hidpi-wrong-repaint-rect-when-parent-has-noncompositing-transform.html: Added.

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

6 years ago[Cocoa] Crash in -[WKWebProcessPlugInHitTestResult nodeHandle] when nodeHandle()...
mitz@apple.com [Sat, 19 Apr 2014 17:46:07 +0000 (17:46 +0000)]
[Cocoa] Crash in -[WKWebProcessPlugInHitTestResult nodeHandle] when nodeHandle() is null
https://bugs.webkit.org/show_bug.cgi?id=131888

Reviewed by Jon Honeycutt.

* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInHitTestResult.mm:
(-[WKWebProcessPlugInHitTestResult nodeHandle]): Added a null check.

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

6 years ago[iOS WK2] Fuzzy layers on sites using perspective and transforms
simon.fraser@apple.com [Sat, 19 Apr 2014 17:36:22 +0000 (17:36 +0000)]
[iOS WK2] Fuzzy layers on sites using perspective and transforms
https://bugs.webkit.org/show_bug.cgi?id=131873
<rdar://problem/16540576>

Reviewed by Sam Weinig.

Always set rasterizationScale on CALayers in the UI process
(as we do for WK1) so that layers are rasterized taking the
device scale into account. We can do unconditionally; this
is benign on layers that CA doesn't rasterize.

* Shared/mac/RemoteLayerTreePropertyApplier.mm:
(WebKit::applyPropertiesToLayer):

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

6 years agoUse 'override' in GraphicsLayerCA
simon.fraser@apple.com [Sat, 19 Apr 2014 17:36:16 +0000 (17:36 +0000)]
Use 'override' in GraphicsLayerCA
https://bugs.webkit.org/show_bug.cgi?id=131882

Reviewed by Tim Horton.

Source/WebCore:

Add 'override' to all overridden functions. Found a few that need
not have been virtual. Removed "allowTiledLayer" stuff that was
never called.

* WebCore.exp.in:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::GraphicsLayerCA):
(WebCore::GraphicsLayerCA::requiresTiledLayer):
(WebCore::GraphicsLayerCA::setAllowTiledLayer): Deleted.
* platform/graphics/ca/GraphicsLayerCA.h:
(WebCore::GraphicsLayerCA::platformCALayer):
(WebCore::GraphicsLayerCA::hasContentsLayer): Deleted.
(WebCore::GraphicsLayerCA::allowTiledLayer): Deleted.
(WebCore::GraphicsLayerCA::isGraphicsLayerCA): Deleted.
(WebCore::GraphicsLayerCA::platformCALayerLayoutSublayersOfLayer): Deleted.
(WebCore::GraphicsLayerCA::platformCALayerRespondsToLayoutChanges): Deleted.
(WebCore::GraphicsLayerCA::platformCALayerContentsOrientation): Deleted.
(WebCore::GraphicsLayerCA::platformCALayerShowDebugBorders): Deleted.
(WebCore::GraphicsLayerCA::platformCALayerIncrementRepaintCount): Deleted.
(WebCore::GraphicsLayerCA::platformCALayerContentsOpaque): Deleted.
(WebCore::GraphicsLayerCA::platformCALayerDrawsContent): Deleted.
(WebCore::GraphicsLayerCA::platformCALayerLayerDidDisplay): Deleted.

Source/WebKit2:

Add an 'override'.

* WebProcess/WebPage/mac/GraphicsLayerCARemote.h:

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

6 years agoAssertion in WebPage::runModal accesses object after it may have been destroyed
darin@apple.com [Sat, 19 Apr 2014 17:04:52 +0000 (17:04 +0000)]
Assertion in WebPage::runModal accesses object after it may have been destroyed
https://bugs.webkit.org/show_bug.cgi?id=131875

Reviewed by Anders Carlsson.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::runModal): Ref the WebPage so it's still around so we can
check the m_isRunningModal flag.

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

6 years ago[WebGL] Two tests failing on Mountain Lion after r167520
dino@apple.com [Sat, 19 Apr 2014 06:57:27 +0000 (06:57 +0000)]
[WebGL] Two tests failing on Mountain Lion after r167520
https://bugs.webkit.org/show_bug.cgi?id=131886

Skip two failing tests.

* platform/mac/TestExpectations:

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

6 years agoREGRESSION(r164205): WebKit crash @StructureIDTable::get.
mark.lam@apple.com [Sat, 19 Apr 2014 06:53:46 +0000 (06:53 +0000)]
REGRESSION(r164205): WebKit crash @StructureIDTable::get.
<https://webkit.org/b/130539>

Reviewed by Geoffrey Garen.

prepareOSREntry() prepares for OSR entry by first copying the local var
values from the baseline frame to a scartch buffer, which is then used
to fill in the locals in their new position in the DFG frame.  Unfortunately,
prepareOSREntry() was using the DFG frame's frameRegisterCount as the frame
size of the baseline frame.  As a result, some values of locals in the
baseline frame were not saved off, and the DFG frame may get initialized
with random content that happened to be in the uninitialized (and possibly
unallocated) portions of the scratch buffer.

The fix is to use OSREntryData::m_expectedValues.numberOfLocals() as the
number of locals in the baseline frame that we want to copy to the scratch
buffer.

Note: osrEntryThunkGenerator() is expecting the DFG frameRegisterCount
at offset 0 in the scratch buffer.  So, we continue to write that value
there, not the baseline frame size.

* dfg/DFGOSREntry.cpp:
(JSC::DFG::prepareOSREntry):

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

6 years agoSkip fast/dom/gc-attribute-node.html which is flaky
timothy@apple.com [Sat, 19 Apr 2014 06:04:56 +0000 (06:04 +0000)]
Skip fast/dom/gc-attribute-node.html which is flaky
https://bugs.webkit.org/show_bug.cgi?id=131885

* platform/mac/TestExpectations:

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

6 years agoWeb Inspector: Move InspectorProfilerAgent to JavaScriptCore
timothy@apple.com [Sat, 19 Apr 2014 06:03:40 +0000 (06:03 +0000)]
Web Inspector: Move InspectorProfilerAgent to JavaScriptCore
https://bugs.webkit.org/show_bug.cgi?id=131673

Passes existing profiler and inspector tests.

Reviewed by Joseph Pecoraro.

* CMakeLists.txt:
* DerivedSources.make:

Source/JavaScriptCore:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
* inspector/JSConsoleClient.cpp:
(Inspector::JSConsoleClient::JSConsoleClient):
(Inspector::JSConsoleClient::profile):
(Inspector::JSConsoleClient::profileEnd):
(Inspector::JSConsoleClient::count): Deleted.
* inspector/JSConsoleClient.h:
* inspector/JSGlobalObjectInspectorController.cpp:
(Inspector::JSGlobalObjectInspectorController::JSGlobalObjectInspectorController):
* inspector/agents/InspectorProfilerAgent.cpp: Added.
(Inspector::InspectorProfilerAgent::InspectorProfilerAgent):
(Inspector::InspectorProfilerAgent::~InspectorProfilerAgent):
(Inspector::InspectorProfilerAgent::addProfile):
(Inspector::InspectorProfilerAgent::createProfileHeader):
(Inspector::InspectorProfilerAgent::enable):
(Inspector::InspectorProfilerAgent::disable):
(Inspector::InspectorProfilerAgent::getUserInitiatedProfileName):
(Inspector::InspectorProfilerAgent::getProfileHeaders):
(Inspector::buildInspectorObject):
(Inspector::InspectorProfilerAgent::buildProfileInspectorObject):
(Inspector::InspectorProfilerAgent::getCPUProfile):
(Inspector::InspectorProfilerAgent::removeProfile):
(Inspector::InspectorProfilerAgent::reset):
(Inspector::InspectorProfilerAgent::didCreateFrontendAndBackend):
(Inspector::InspectorProfilerAgent::willDestroyFrontendAndBackend):
(Inspector::InspectorProfilerAgent::start):
(Inspector::InspectorProfilerAgent::stop):
(Inspector::InspectorProfilerAgent::setRecordingProfile):
(Inspector::InspectorProfilerAgent::startProfiling):
(Inspector::InspectorProfilerAgent::stopProfiling):
* inspector/agents/InspectorProfilerAgent.h: Added.
* inspector/agents/JSGlobalObjectProfilerAgent.cpp: Copied from Source/WebCore/inspector/ScriptProfile.idl.
(Inspector::JSGlobalObjectProfilerAgent::JSGlobalObjectProfilerAgent):
(Inspector::JSGlobalObjectProfilerAgent::profilingGlobalExecState):
* inspector/agents/JSGlobalObjectProfilerAgent.h: Copied from Source/WebCore/inspector/ScriptProfile.idl.
* inspector/protocol/Profiler.json: Renamed from Source/WebCore/inspector/protocol/Profiler.json.
* profiler/Profile.h:
* runtime/ConsoleClient.h:

Source/WebCore:
* ForwardingHeaders/inspector/agents/InspectorProfilerAgent.h: Added.
* WebCore.exp.in:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/ScriptProfile.cpp: Removed.
* bindings/js/ScriptProfile.h:
* bindings/js/ScriptProfiler.cpp: Removed.
* bindings/js/ScriptProfiler.h: Removed.
* inspector/InspectorAllInOne.cpp:
* inspector/InspectorConsoleInstrumentation.h:
(WebCore::InspectorInstrumentation::profilerEnabled):
(WebCore::InspectorInstrumentation::startProfiling):
(WebCore::InspectorInstrumentation::stopProfiling):
* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
* inspector/InspectorController.h:
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didCommitLoadImpl):
(WebCore::InspectorInstrumentation::startProfilingImpl):
(WebCore::InspectorInstrumentation::stopProfilingImpl):
(WebCore::InspectorInstrumentation::consoleTimeStampImpl): Deleted.
* inspector/InspectorInstrumentation.h:
* inspector/InspectorProfilerAgent.cpp: Removed.
* inspector/InspectorProfilerAgent.h: Removed.
* inspector/InspectorTimelineAgent.cpp:
(WebCore::startProfiling):
(WebCore::stopProfiling):
(WebCore::InspectorTimelineAgent::willCallFunction):
(WebCore::InspectorTimelineAgent::didCallFunction):
(WebCore::InspectorTimelineAgent::willEvaluateScript):
(WebCore::InspectorTimelineAgent::didEvaluateScript):
(WebCore::InspectorTimelineAgent::didDispatchXHRLoadEvent): Deleted.
* inspector/InstrumentingAgents.h:
(WebCore::InstrumentingAgents::inspectorProfilerAgent):
(WebCore::InstrumentingAgents::setInspectorProfilerAgent):
* inspector/PageDebuggerAgent.cpp:
(WebCore::PageDebuggerAgent::sourceMapURLForScript): Deleted.
* inspector/PageDebuggerAgent.h:
* inspector/PageProfilerAgent.cpp: Added.
(WebCore::PageProfilerAgent::PageProfilerAgent):
(WebCore::PageProfilerAgent::profilingGlobalExecState):
* inspector/PageProfilerAgent.h: Added.
(WebCore::PageProfilerAgent::~PageProfilerAgent):
* inspector/ScriptProfile.idl:
* inspector/TimelineRecordFactory.cpp:
(WebCore::TimelineRecordFactory::appendProfile):
* inspector/TimelineRecordFactory.h:
* inspector/WebConsoleAgent.cpp:
* inspector/WebProfilerAgent.cpp: Added.
(WebCore::WebProfilerAgent::WebProfilerAgent):
(WebCore::WebProfilerAgent::enable):
(WebCore::WebProfilerAgent::disable):
* inspector/WebProfilerAgent.h: Added.
(WebCore::WebProfilerAgent::~WebProfilerAgent):
* inspector/WorkerInspectorController.cpp:
(WebCore::WorkerInspectorController::WorkerInspectorController):
* inspector/WorkerProfilerAgent.cpp: Added.
(WebCore::WorkerProfilerAgent::WorkerProfilerAgent):
(WebCore::WorkerProfilerAgent::profilingGlobalExecState):
* inspector/WorkerProfilerAgent.h: Added.
(WebCore::WorkerProfilerAgent::~WorkerProfilerAgent):
* loader/appcache/ApplicationCacheGroup.cpp:
* page/PageConsole.cpp:
(WebCore::PageConsole::profile):
(WebCore::PageConsole::profileEnd):
(WebCore::PageConsole::time): Deleted.
(WebCore::PageConsole::timeEnd): Deleted.
(WebCore::PageConsole::timeStamp): Deleted.
* page/PageConsole.h:
* testing/Internals.cpp:
* testing/Internals.h:
* xml/XMLHttpRequest.cpp:

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

6 years agoContents of directly composited image layers are sometimes missing
simon.fraser@apple.com [Sat, 19 Apr 2014 05:31:39 +0000 (05:31 +0000)]
Contents of directly composited image layers are sometimes missing
https://bugs.webkit.org/show_bug.cgi?id=131880

Reviewed by Tim Horton.

Source/WebCore:
RenderLayerBacking::updateGraphicsLayerGeometry() tested whether a
GraphicsLayer had a contents layer to determine whether to call code
that updates the contents rect. However, on Mac, we don't make a contents
layer until later at layer flush time. That would result in an empty
contentsRect being set.

Fix by renaming GraphicsLayer::hasContentsLayer() to usesContentsLayer(),
and on Mac consulting the m_contentsLayerPurpose flag, which is set
at the appropriate time.

Test: compositing/images/update-content-rect.html

* platform/ScrollView.cpp:
(WebCore::positionScrollbarLayer):
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::getDebugBorderInfo):
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::usesContentsLayer):
(WebCore::GraphicsLayer::hasContentsLayer): Deleted.
* platform/graphics/ca/GraphicsLayerCA.h:
(WebCore::GraphicsLayerCA::hasContentsLayer): Deleted.
* platform/graphics/texmap/GraphicsLayerTextureMapper.h:
(WebCore::GraphicsLayerTextureMapper::usesContentsLayer):
(WebCore::GraphicsLayerTextureMapper::hasContentsLayer): Deleted.
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
(WebCore::RenderLayerBacking::positionOverflowControlsLayers):
(WebCore::RenderLayerBacking::compositingLayerType):

LayoutTests:
Test that that shows the issue in Safari, but not in the test
runner because of timing issues, but maybe it will some day.

* compositing/images/update-content-rect-expected.html: Added.
* compositing/images/update-content-rect.html: Added.

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

6 years agoUnreviewed, rolling out r167527.
commit-queue@webkit.org [Sat, 19 Apr 2014 05:19:30 +0000 (05:19 +0000)]
Unreviewed, rolling out r167527.
https://bugs.webkit.org/show_bug.cgi?id=131883

Broke 32-bit build (Requested by ap on #webkit).

Reverted changeset:

"[Mac] implement WebKitDataCue"
https://bugs.webkit.org/show_bug.cgi?id=131799
http://trac.webkit.org/changeset/167527

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

6 years ago[Mac] implement WebKitDataCue
eric.carlson@apple.com [Sat, 19 Apr 2014 03:46:44 +0000 (03:46 +0000)]
[Mac] implement WebKitDataCue
https://bugs.webkit.org/show_bug.cgi?id=131799

Reviewed by Dean Jackson.

Source/JavaScriptCore:
* Configurations/FeatureDefines.xcconfig: Define ENABLE_DATACUE_VALUE.

Source/WebCore:
Tests: http/tests/media/track-in-band-hls-metadata.html
       media/track/track-datacue-value.html

* Configurations/FeatureDefines.xcconfig: Define ENABLE_DATACUE_VALUE.
* DerivedSources.make: Add ENABLE_DATACUE_VALUE to HTML_FLAGS when appropriate.

* CMakeLists.txt: Add JSDataCueCustom.cpp.
* bindings/js/JSBindingsAllInOne.cpp:
* WebCore.xcodeproj/project.pbxproj: Add new files.

* bindings/js/JSDataCueCustom.cpp: Added.
(WebCore::JSDataCue::value):
(WebCore::JSDataCue::setValue):
(WebCore::JSDataCueConstructor::constructJSDataCue): Custom constructor.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::updateActiveTextTrackCues): Drive-by fixes: don't schedule timeupdate
    events when paused, don't call sort on an Vector that can't be sorted.

* html/track/DataCue.cpp:
(WebCore::DataCue::DataCue): Initialize m_type.
(WebCore::DataCue::~DataCue): Unprotect the JSValue if necessary.
(WebCore::DataCue::data): Ask the platform value for data if non-null.
(WebCore::DataCue::setData): Clear m_platformValue and m_value.
(WebCore::DataCue::isEqual): New.
(WebCore::DataCue::value): Return a JSValue from the platform value, or the value passed
    to the constructor/set by script.
(WebCore::DataCue::setValue): Set m_value.
* html/track/DataCue.h:
* html/track/DataCue.idl:

* html/track/InbandDataTextTrack.cpp:
(WebCore::InbandDataTextTrack::addDataCue): Don't add the same cue more than once.
(WebCore::InbandDataTextTrack::updateDataCue): Update a cue's duration.
(WebCore::InbandDataTextTrack::removeDataCue): Remove an incomplete cue.
(WebCore::InbandDataTextTrack::removeCue): Remove a cue from the incomplete cue map if necessary.
* html/track/InbandDataTextTrack.h:

* html/track/InbandGenericTextTrack.cpp:
(WebCore::InbandGenericTextTrack::addGenericCue): CueMatchRules is now in TextTrackCue instead
    of VTTCue.
* html/track/InbandTextTrack.h:

* html/track/InbandWebVTTTextTrack.cpp:
(WebCore::InbandWebVTTTextTrack::newCuesParsed): Ditto.

* html/track/TextTrack.cpp:
(WebCore::TextTrack::hasCue): Ditto.
* html/track/TextTrack.h:

* html/track/TextTrackCue.cpp:
(WebCore::TextTrackCue::isEqual): New, test base class equality.
* html/track/TextTrackCue.h:

* html/track/TextTrackCueGeneric.cpp:
(WebCore::TextTrackCueGeneric::isEqual): Call TextTrackCue::isEqual first.
* html/track/TextTrackCueGeneric.h:

* html/track/VTTCue.cpp:
(WebCore::VTTCue::isEqual): Call TextTrackCue::isEqual first.
* html/track/VTTCue.h:

* platform/SerializedPlatformRepresentation.h: Added.
(WebCore::SerializedPlatformRepresentation::~SerializedPlatformRepresentation):
(WebCore::SerializedPlatformRepresentation::SerializedPlatformRepresentation):

* platform/graphics/InbandTextTrackPrivateClient.h: Add methods for DataCue with SerializedPlatformRepresentation.

* platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp: Added.
(WebCore::InbandMetadataTextTrackPrivateAVF::create):
(WebCore::InbandMetadataTextTrackPrivateAVF::InbandMetadataTextTrackPrivateAVF):
(WebCore::InbandMetadataTextTrackPrivateAVF::~InbandMetadataTextTrackPrivateAVF):
(WebCore::InbandMetadataTextTrackPrivateAVF::addDataCue):
(WebCore::InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes):
(WebCore::InbandMetadataTextTrackPrivateAVF::flushPartialCues):
* platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.h: Added.

* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::seekWithTolerance): currentTrack -> currentTextTrack.
(WebCore::MediaPlayerPrivateAVFoundation::seekCompleted): Ditto.
(WebCore::MediaPlayerPrivateAVFoundation::configureInbandTracks): Ditto.
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
(WebCore::MediaPlayerPrivateAVFoundation::setCurrentTextTrack):
(WebCore::MediaPlayerPrivateAVFoundation::setCurrentTrack): Deleted.

Renamed currentTrack and setCurrentTrack to currentTextTrack and setCurrentTextTrack.
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::AVFWrapper::currentTextTrack):
(WebCore::MediaPlayerPrivateAVFoundationCF::setCurrentTextTrack):
(WebCore::MediaPlayerPrivateAVFoundationCF::currentTextTrack):
(WebCore::AVFWrapper::setCurrentTextTrack):
(WebCore::AVFWrapper::AVFWrapper):
(WebCore::AVFWrapper::processCue):
(WebCore::AVFWrapper::currentTrack): Deleted.
(WebCore::MediaPlayerPrivateAVFoundationCF::setCurrentTrack): Deleted.
(WebCore::MediaPlayerPrivateAVFoundationCF::currentTrack): Deleted.
(WebCore::AVFWrapper::setCurrentTrack): Deleted.
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
(WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime): currentTrack -> currentTextTrack
(WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged): currentTrack -> currentTextTrack.
(WebCore::MediaPlayerPrivateAVFoundationObjC::processMetadataTrack): New.
(WebCore::MediaPlayerPrivateAVFoundationObjC::processCue): m_currentTrack -> m_currentTextTrack.
(WebCore::MediaPlayerPrivateAVFoundationObjC::flushCues): Ditto.
(WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTextTrack): Renamed from setCurrentTextTrack.
(WebCore::metadataType): Map an AVFoundation metadata key space to a metadata cue type.
(WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive): Process new metadata.
(-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTrack): Deleted.

Create a JSValue representation from an AVMetadataItem.
* platform/mac/SerializedPlatformRepresentationMac.h: Added.
(WebCore::SerializedPlatformRepresentationMac::platformType):
(WebCore::SerializedPlatformRepresentationMac::nativeValue):
* platform/mac/SerializedPlatformRepresentationMac.mm: Added.
(WebCore::SerializedPlatformRepresentationMac::SerializedPlatformRepresentationMac):
(WebCore::SerializedPlatformRepresentationMac::~SerializedPlatformRepresentationMac):
(WebCore::SerializedPlatformRepresentationMac::create):
(WebCore::SerializedPlatformRepresentationMac::data):
(WebCore::SerializedPlatformRepresentationMac::deserialize):
(WebCore::SerializedPlatformRepresentationMac::isEqual):
(WebCore::toSerializedPlatformRepresentationMac):
(WebCore::jsValueWithValueInContext):
(WebCore::jsValueWithDataInContext):
(WebCore::jsValueWithArrayInContext):
(WebCore::jsValueWithDictionaryInContext):
(WebCore::jsValueWithAVMetadataItemInContext):

Source/WebKit/mac:
* Configurations/FeatureDefines.xcconfig: Define ENABLE_DATACUE_VALUE.

Source/WebKit2:
* Configurations/FeatureDefines.xcconfig: Define ENABLE_DATACUE_VALUE.

Source/WTF:
* wtf/FeatureDefines.h: Define ENABLE_DATACUE_VALUE.

LayoutTests:
* http/tests/media/resources/hls: Added.
* http/tests/media/resources/hls/metadata: Added.
* http/tests/media/resources/hls/metadata/fileSequence0.ts: Added.
* http/tests/media/resources/hls/metadata/fileSequence1.ts: Added.
* http/tests/media/resources/hls/metadata/fileSequence2.ts: Added.
* http/tests/media/resources/hls/metadata/fileSequence3.ts: Added.
* http/tests/media/resources/hls/metadata/prog_index.m3u8: Added.
* http/tests/media/track-in-band-hls-metadata-expected.txt: Added.
* http/tests/media/track-in-band-hls-metadata.html: Added.
* media/track/track-datacue-value-expected.txt: Added.
* media/track/track-datacue-value.html: Added.
* platform/efl/TestExpectations: Skip the new tests.
* platform/gtk/TestExpectations: Ditto.
* platform/mac/js/dom/global-constructors-attributes-expected.txt: Update.
* platform/mac-mountainlion/js/dom/global-constructors-attributes-expected.txt: Update.
* platform/mac/TestExpectations: Skip DataCue test on all Mac versions. Skip HLS test on
    Mountain Lion.
* platform/win/TestExpectations: Skip the new tests.

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