WebKit-https.git
6 years agoWeb Inspector: Add infrastructure for eslint based static analyzer
jonowells@apple.com [Tue, 11 Nov 2014 00:39:11 +0000 (00:39 +0000)]
Web Inspector: Add infrastructure for eslint based static analyzer
https://bugs.webkit.org/show_bug.cgi?id=137890

Reviewed by Timothy Hatcher.

Fix to previous patch to add AnalyzerManager and AnalyzerMessage classes. Changed Main.html to include ESLint.js
before Main.js in the combined resources.

* UserInterface/Base/Main.js:
* UserInterface/Controllers/AnalyzerManager.js: Added.
(WebInspector.AnalyzerManager):
(set WebInspector.AnalyzerManager.prototype.getAnalyzerMessagesForSourceCode.):
(set WebInspector.AnalyzerManager.prototype.getAnalyzerMessagesForSourceCode):
(set WebInspector.AnalyzerManager.prototype.set get sourceCodeCanBeAnalyzed):
(set WebInspector.AnalyzerManager.prototype._handleSourceCodeContentDidChange):
* UserInterface/Main.html:
* UserInterface/Models/AnalyzerMessage.js: Added.
(WebInspector.AnalyzerMessage):
(WebInspector.AnalyzerMessage.prototype.get sourceCodeLocation):
(WebInspector.AnalyzerMessage.prototype.get sourceCode):
(WebInspector.AnalyzerMessage.prototype.get text):
(WebInspector.AnalyzerMessage.prototype.get ruleIdentifier):
* UserInterface/Models/SourceCode.js:

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

6 years agoWK1: Support default actions for editable whitespace
bdakin@apple.com [Tue, 11 Nov 2014 00:04:56 +0000 (00:04 +0000)]
WK1: Support default actions for editable whitespace
https://bugs.webkit.org/show_bug.cgi?id=138586
-and corresponding-
rdar://problem/18932048

Reviewed by Tim Horton.

New menu type. Just wants paste.

* WebView/WebActionMenuController.mm:
(-[WebActionMenuController isMenuForTextContent]):
(-[WebActionMenuController _defaultMenuItemsForWhitespaceInEditableArea:]):
(-[WebActionMenuController _defaultMenuItemsForHitTestResult:]):
* WebView/WebUIDelegatePrivate.h:

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

6 years agoRemove unnecessary null check in FrameSelection::nodeWillBeRemoved()
cdumez@apple.com [Tue, 11 Nov 2014 00:02:57 +0000 (00:02 +0000)]
Remove unnecessary null check in FrameSelection::nodeWillBeRemoved()
https://bugs.webkit.org/show_bug.cgi?id=138578

Reviewed by Andreas Kling.

Remove unnecessary null check in FrameSelection::nodeWillBeRemoved()
and turn the argument into a reference to make it clear it cannot be
null.

No new tests, no behavior change.

* dom/ContainerNode.cpp:
(WebCore::ContainerNode::willRemoveChild):
* dom/Document.cpp:
(WebCore::Document::nodeChildrenWillBeRemoved):
(WebCore::Document::nodeWillBeRemoved):
* dom/Document.h:
* dom/NodeIterator.cpp:
(WebCore::NodeIterator::nodeWillBeRemoved):
(WebCore::NodeIterator::updateForNodeRemoval):
* dom/NodeIterator.h:
* dom/Range.cpp:
(WebCore::Range::insertNode):
(WebCore::boundaryNodeWillBeRemoved):
(WebCore::Range::nodeWillBeRemoved):
* dom/Range.h:
* dom/RangeBoundaryPoint.h:
(WebCore::RangeBoundaryPoint::setToBeforeChild):
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::updatePositionForNodeRemovalPreservingChildren):
* editing/CompositeEditCommand.h:
* editing/DeleteSelectionCommand.cpp:
(WebCore::DeleteSelectionCommand::removeNode):
(WebCore::DeleteSelectionCommand::handleGeneralDelete):
(WebCore::DeleteSelectionCommand::removeRedundantBlocks):
* editing/FrameSelection.cpp:
(WebCore::removingNodeRemovesPosition):
(WebCore::DragCaretController::nodeWillBeRemoved):
(WebCore::FrameSelection::nodeWillBeRemoved):
(WebCore::FrameSelection::respondToNodeModification):
* editing/FrameSelection.h:
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::mergeTextNodesAroundPosition):
* editing/htmlediting.cpp:
(WebCore::updatePositionForNodeRemoval):
* editing/htmlediting.h:
* page/EventHandler.cpp:
(WebCore::EventHandler::nodeWillBeRemoved):
* page/EventHandler.h:

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

6 years agoWhitespace action menus aren't working properly
bdakin@apple.com [Mon, 10 Nov 2014 23:55:56 +0000 (23:55 +0000)]
Whitespace action menus aren't working properly
https://bugs.webkit.org/show_bug.cgi?id=138585
-and corresponding-
rdar://problem/18933586

Reviewed by Tim Horton.

Treat the whitespace menu as a text menu.
* UIProcess/mac/WKActionMenuController.mm:
(-[WKActionMenuController isMenuForTextContent]):

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

6 years agoAdd test for fix of REGRESSION (r174985-174986): Site display disappears
msaboff@apple.com [Mon, 10 Nov 2014 23:23:49 +0000 (23:23 +0000)]
Add test for fix of REGRESSION (r174985-174986): Site display disappears
https://bugs.webkit.org/show_bug.cgi?id=138470

Reviewed by Geoffrey Garen.

This checks that document.write() and document.writeln() are cached and the same instance
is always returned.

* js/dom/document-write-functions-cached-expected.txt: Added.
* js/dom/document-write-functions-cached.html: Added.

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

6 years agoFix the build when CSS Selectors Level 4 is disabled
benjamin@webkit.org [Mon, 10 Nov 2014 22:48:10 +0000 (22:48 +0000)]
Fix the build when CSS Selectors Level 4 is disabled
https://bugs.webkit.org/show_bug.cgi?id=138533

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

* css/CSSSelector.cpp:
(WebCore::appendArgumentList):
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementLinkMatching):

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

6 years agoWK1: Support default actions for editable text
bdakin@apple.com [Mon, 10 Nov 2014 22:36:21 +0000 (22:36 +0000)]
WK1: Support default actions for editable text
https://bugs.webkit.org/show_bug.cgi?id=138580
-and corresponding-
rdar://problem/18877497

Reviewed by Tim Horton.

New menu type, and new action type for paste.

* WebView/WebActionMenuController.mm:
(-[WebActionMenuController isMenuForTextContent]):
(-[WebActionMenuController willOpenMenu:withEvent:]):
(-[WebActionMenuController _defaultMenuItemsForEditableText:]):
(-[WebActionMenuController _paste:]):
(-[WebActionMenuController _createActionMenuItemForTag:withHitTestResult:]):
(-[WebActionMenuController _defaultMenuItemsForHitTestResult:]):
* WebView/WebUIDelegatePrivate.h:

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

6 years agoWK1: Text is getting selected even when an action menu fails to invoke
bdakin@apple.com [Mon, 10 Nov 2014 22:12:01 +0000 (22:12 +0000)]
WK1: Text is getting selected even when an action menu fails to invoke
https://bugs.webkit.org/show_bug.cgi?id=138576
-and corresponding-
rdar://problem/18931330

Reviewed by Tim Horton.

Selection changes should happen in willOpenMenu: instead of prepareForMenu:
* WebView/WebActionMenuController.h:
* WebView/WebActionMenuController.mm:
(-[WebActionMenuController prepareForMenu:withEvent:]):
(-[WebActionMenuController willOpenMenu:withEvent:]):

_selectLookupText no longer needs to return a BOOL indicating success or failure.
(-[WebActionMenuController _selectLookupText]):
(-[WebActionMenuController _defaultMenuItemsForHitTestResult:]):

Pass willOpenMenu: on to the controller.
* WebView/WebView.mm:
(-[WebView willOpenMenu:withEvent:]):

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

6 years agoSupport throttling of DOMTimers using nested setTimeout() calls
cdumez@apple.com [Mon, 10 Nov 2014 22:05:52 +0000 (22:05 +0000)]
Support throttling of DOMTimers using nested setTimeout() calls
https://bugs.webkit.org/show_bug.cgi?id=138262

Reviewed by Gavin Barraclough.

Extend DOMTimers throttling support to timers that are using nested
setTimeout() calls instead of a setInterval(). To achieve this, this
patch introduces a NestedTimersMap singleton class where nested timers
are added, and for which we potentially update the next firing time,
after the parent timer is done executing.

I have verified this helps on ebay.com for example, which has timers
interacting with non-visible plugins that are scheduled using nested
setTimeout() calls with a frequency of 150 / 200 ms.

This is a second take on r175441, which caused intermittent crashes.
This time, nested timers are removed from the NestedTimersMap when
DOMTimer::removeById() is called. It would be unsafe to use the nested
timer afterwards because we don't hold a strong reference to it and
the ScriptExecutionContext is unref'ing the DOMTimer when
ScriptExecutionContext::removeTimeout() is called from
DOMTimer::removeById().

* page/DOMTimer.cpp:
(WebCore::NestedTimersMap::NestedTimersMap):
(WebCore::NestedTimersMap::~NestedTimersMap):
(WebCore::NestedTimersMap::add):
(WebCore::NestedTimersMap::remove):
(WebCore::NestedTimersMap::begin):
(WebCore::NestedTimersMap::end):
(WebCore::DOMTimer::install):
(WebCore::DOMTimer::removeById):
(WebCore::DOMTimer::fired):

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

6 years agoUnreviewed, moved myself to the list of committers.
conrad_shultz@apple.com [Mon, 10 Nov 2014 22:01:59 +0000 (22:01 +0000)]
Unreviewed, moved myself to the list of committers.

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

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

6 years ago[EME][Mac] Add a systemCode to distinguish when no expired sessions were found in...
jer.noble@apple.com [Mon, 10 Nov 2014 21:48:01 +0000 (21:48 +0000)]
[EME][Mac] Add a systemCode to distinguish when no expired sessions were found in response to a "keyrelease" message.
https://bugs.webkit.org/show_bug.cgi?id=138199

Reviewed by Eric Carlson.

Clients may want to be able to distinguish between cases where expired session data is not supported, and when
those data are supported, but none are found.

* platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
(WebCore::CDMSessionMediaSourceAVFObjC::generateKeyReleaseMessage):

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

6 years ago[iOS WK2] Scroll deceleration rate is wrong
simon.fraser@apple.com [Mon, 10 Nov 2014 21:39:02 +0000 (21:39 +0000)]
[iOS WK2] Scroll deceleration rate is wrong
https://bugs.webkit.org/show_bug.cgi?id=138574
rdar://problem/18715303

Reviewed by Benjamin Poulain.

The CSS Snap Points code incorrectly set the WKScrollView's deceleration rate,
overriding the custom value that UIWebScrollView sets.

Fix by having WKScrollView store the custom rate at init time, and
using that value in -scrollViewWillBeginDragging:.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView scrollViewWillBeginDragging:]):
* UIProcess/ios/WKScrollView.h:
* UIProcess/ios/WKScrollView.mm:
(-[WKScrollView initWithFrame:]):

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

6 years agoREGRESSION(r174823): Several tests fail due to canplaythrough firing before tracks...
jer.noble@apple.com [Mon, 10 Nov 2014 20:43:50 +0000 (20:43 +0000)]
REGRESSION(r174823): Several tests fail due to canplaythrough firing before tracks are available
https://bugs.webkit.org/show_bug.cgi?id=137882

Reviewed by Eric Carlson.

Source/WebCore:

For HLS streams with only one video, audio, or text track, there will be no media selection group
for that media characteristic. When culling out AVPlayerItemTracks in tracksDidChange(), do not skip
tracks for which there is no matching AVMediaSelectionGroup.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::hasLoadedMediaSelectionGroups): Refactored.
(WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForLegibleMedia): Call above.
(WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForAudibleMedia): Ditto.
(WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForVisualMedia): Ditto.
(WebCore::MediaPlayerPrivateAVFoundationObjC::tracksDidChange):

LayoutTests:

* platform/mac/TestExpectations:
* platform/mac/http/tests/media/hls/video-controls-live-stream-expected.txt:

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

6 years agoSpeculative build fix.
bdakin@apple.com [Mon, 10 Nov 2014 20:39:24 +0000 (20:39 +0000)]
Speculative build fix.

* WebView/WebActionMenuController.mm:

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

6 years agoUnreviewed, rolling out r175813.
commit-queue@webkit.org [Mon, 10 Nov 2014 20:33:33 +0000 (20:33 +0000)]
Unreviewed, rolling out r175813.
https://bugs.webkit.org/show_bug.cgi?id=138573

Breaks complex text layout spacing (Requested by litherum on
#webkit).

Reverted changeset:

"[OSX] Some words are placed on top of each other in complex
text layout"
https://bugs.webkit.org/show_bug.cgi?id=138348
http://trac.webkit.org/changeset/175813

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

6 years agoRolling out failed build fix
bdakin@apple.com [Mon, 10 Nov 2014 20:31:53 +0000 (20:31 +0000)]
Rolling out failed build fix
http://trac.webkit.org/changeset/175819

* WebCore.exp.in:

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

6 years agoReset WebPageProxy's isPlayingAudio state after web process crash or page invalidation.
adachan@apple.com [Mon, 10 Nov 2014 20:31:49 +0000 (20:31 +0000)]
Reset WebPageProxy's isPlayingAudio state after web process crash or page invalidation.
https://bugs.webkit.org/show_bug.cgi?id=138559

Reviewed by Andreas Kling.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::resetState):

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

6 years agoAction menu initialization should be moved to _commonInitializationWithFrameName
bdakin@apple.com [Mon, 10 Nov 2014 20:25:13 +0000 (20:25 +0000)]
Action menu initialization should be moved to _commonInitializationWithFrameName
https://bugs.webkit.org/show_bug.cgi?id=138572
-and corresponding-
rdar://problem/18929733

Reviewed by Tim Horton.

* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):
(-[WebView _initWithFrame:frameName:groupName:]):

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

6 years agoSpeculative build fix.
bdakin@apple.com [Mon, 10 Nov 2014 20:18:32 +0000 (20:18 +0000)]
Speculative build fix.

* WebCore.exp.in:

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

6 years agoSpeculative build fix.
bdakin@apple.com [Mon, 10 Nov 2014 20:15:42 +0000 (20:15 +0000)]
Speculative build fix.

* WebCore.exp.in:

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

6 years ago[iOS WK2] Layers with negative z position disapear behind the page tiles
simon.fraser@apple.com [Mon, 10 Nov 2014 20:03:44 +0000 (20:03 +0000)]
[iOS WK2] Layers with negative z position disapear behind the page tiles
https://bugs.webkit.org/show_bug.cgi?id=138571
rdar://problem/18873480

Reviewed by Dean Jackson.

Some crufty iOS-only code in RenderLayerBacking::parentForSublayers() caused us to fail
to use the m_childContainmentLayer as the ancestor for descendants, so layers with
negative z position would get depth-sorted behind the tiles.

Fix by removing that code.

This should have been detected by compositing/tile-cache-must-flatten.html, but
testing infrastructure suck prevented us from doing so.

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::parentForSublayers):
* rendering/RenderLayerBacking.h: Just some nullptr cleanup.

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

6 years agoMove 'resize' CSS property to the new StyleBuilder
cdumez@apple.com [Mon, 10 Nov 2014 19:56:20 +0000 (19:56 +0000)]
Move 'resize' CSS property to the new StyleBuilder
https://bugs.webkit.org/show_bug.cgi?id=138550

Reviewed by Andreas Kling.

No new tests, no behavior change.

Move 'resize' CSS property from DeprecatedStyleBuilder to the new
StyleBuilder by adding a new 'Resize' Converter function.

* css/CSSPropertyNames.in:
* css/DeprecatedStyleBuilder.cpp:
(WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
(WebCore::ApplyPropertyResize::applyValue): Deleted.
(WebCore::ApplyPropertyResize::createHandler): Deleted.
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertResize):

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

6 years agoSpeculative build fix.
bdakin@apple.com [Mon, 10 Nov 2014 19:35:40 +0000 (19:35 +0000)]
Speculative build fix.

* editing/DictionaryLookup.h:
* editing/DictionaryLookup.mm:

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

6 years agoMove 'text-indent' CSS property to the new StyleBuilder
cdumez@apple.com [Mon, 10 Nov 2014 19:34:11 +0000 (19:34 +0000)]
Move 'text-indent' CSS property to the new StyleBuilder
https://bugs.webkit.org/show_bug.cgi?id=138547

Reviewed by Andreas Kling.

Move 'text-indent' CSS property from DeprecatedStyleBuilder to the new
StyleBuilder, by using custom code.

No new tests, no behavior change.

* css/CSSPropertyNames.in:
* css/DeprecatedStyleBuilder.cpp:
(WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
(WebCore::ApplyPropertyTextIndent::applyInheritValue): Deleted.
(WebCore::ApplyPropertyTextIndent::applyInitialValue): Deleted.
(WebCore::ApplyPropertyTextIndent::applyValue): Deleted.
(WebCore::ApplyPropertyTextIndent::createHandler): Deleted.
* css/StyleBuilderConverter.h:
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderFunctions::applyInheritTextIndent):
(WebCore::StyleBuilderFunctions::applyInitialTextIndent):
(WebCore::StyleBuilderFunctions::applyValueTextIndent):

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

6 years agoWK1: Support default actions for read-only text
bdakin@apple.com [Mon, 10 Nov 2014 19:19:52 +0000 (19:19 +0000)]
WK1: Support default actions for read-only text
https://bugs.webkit.org/show_bug.cgi?id=138552
-and corresponding-
rdar://problem/18877483

Reviewed by Tim Horton.

Source/WebCore:

WK1 now needs to do a lot of dictionary lookup operations that it did not
previously have to handle. So this patch takes a lot of that functionality, which
was implemented as static functions in WebPageMac for WK2 and moves it into
WebCore.

* WebCore.exp.in:
* WebCore.xcodeproj/project.pbxproj:
* editing/DictionaryLookup.h: Added.
* editing/DictionaryLookup.mm: Added.
(WebCore::isPositionInRange):
(WebCore::shouldUseSelection):
(WebCore::rangeExpandedAroundPositionByCharacters):
(WebCore::rangeForDictionaryLookupForSelection):
(WebCore::rangeForDictionaryLookupAtHitTestResult):
* platform/mac/WebCoreSystemInterface.h:
* platform/mac/WebCoreSystemInterface.mm:

Source/WebKit/mac:

New WKSystemInterface functions that WebCore needs to use.
* WebCoreSupport/WebSystemInterface.mm:
(InitWebCoreSystemInterface):

WebActionMenuController now keeps an ivar for the WebCore::HitTestResult. This
makes a lot of things easier.
* WebView/WebActionMenuController.h:
* WebView/WebActionMenuController.mm:

Perform the hit test ourselves instead of calling into WebView so that we can more
easily save the WebCore::HitTestResult for ourselves.
(-[WebActionMenuController performHitTestAtPoint:]):

Clear selection for non-text menus.
(-[WebActionMenuController prepareForMenu:withEvent:]):

Re-set the _type here just to be safe.
(-[WebActionMenuController didCloseMenu:withEvent:]):

Moving this method to be next to the link actions so they can be within a pragma
mark.
(-[WebActionMenuController _defaultMenuItemsForLink:]):

New method for default text actions — lookup and copy.
(-[WebActionMenuController _defaultMenuItemsForText:]):
(-[WebActionMenuController _copySelection:]):
(-[WebActionMenuController _lookupText:]):

If there is not already a selection, invoking the action menu on text should
select the lookup text.
(-[WebActionMenuController _selectLookupText]):
(performDictionaryLookupForSelection):
(performDictionaryLookupForRange):

Handle text now.
(-[WebActionMenuController _createActionMenuItemForTag:withHitTestResult:]):
(-[WebActionMenuController _defaultMenuItemsForHitTestResult:]):

New enum values.
* WebView/WebUIDelegatePrivate.h:

Pass didCloseMenu on to the controller.
* WebView/WebView.mm:
(-[WebView didCloseMenu:withEvent:]):

Source/WebKit2:

WK1 now needs to do a lot of dictionary lookup operations that it did not
previously have to handle. So this patch takes a lot of that functionality, which
was implemented as static functions in WebPageMac for WK2 and moves it into
WebCore.

* WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
(InitWebCoreSystemInterface):
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::performDictionaryLookupForRange):
(WebKit::isPositionInRange): Deleted.
(WebKit::shouldUseSelection): Deleted.
(WebKit::rangeExpandedAroundPositionByCharacters): Deleted.
(WebKit::rangeForDictionaryLookupForSelection): Deleted.
(WebKit::rangeForDictionaryLookupAtHitTestResult): Deleted.

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

6 years ago[OSX] Some words are placed on top of each other in complex text layout
mmaxfield@apple.com [Mon, 10 Nov 2014 18:55:08 +0000 (18:55 +0000)]
[OSX] Some words are placed on top of each other in complex text layout
https://bugs.webkit.org/show_bug.cgi?id=138348

Reviewed by Simon Fraser.

Source/WebCore:

Some complex text layouts have lots of diacritics being placed all over the place.
CoreText sometimes compensates for this by adjusting the advances of the glyphs
throughout the string to make glyphs appear in the correct place. This means that
we can't naively cache the width of a space character; instead, we must obey
CoreText when it gives us an advance for a space.

Test: fast/text/large-space-width-complex.html

* platform/graphics/mac/ComplexTextController.cpp:
(WebCore::ComplexTextController::adjustGlyphsAndAdvances):

LayoutTests:

Updating tests to not use cached space width.

* fast/text/large-space-width-complex-expected.html: Added.
* fast/text/large-space-width-complex.html: Added.
* fast/text/resources/NotoNastaliqUrduDraft.ttf: Added.
* platform/mac-mavericks/fast/text/emphasis-expected.png:
* platform/mac-mavericks/fast/text/emphasis-expected.txt: This test is orthogonal to space widths.
* platform/mac-mountainlion/fast/text/emphasis-expected.png:
* platform/mac-mountainlion/fast/text/emphasis-expected.txt:
* platform/mac/fast/text/emphasis-expected.png:
* platform/mac/fast/text/emphasis-expected.txt:
* platform/mac/fast/text/sticky-typesetting-features-expected.png:
* platform/mac/fast/text/sticky-typesetting-features-expected.txt: Ditto.
* platform/mac/fast/writing-mode/text-orientation-basic-expected.png:
* platform/mac/fast/writing-mode/text-orientation-basic-expected.txt: This test actually is improved with
this patch. Instead of a weirdly wide space width, the two words are spaced appropriately now.

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

6 years ago[iOS] wireless playback placeholder UI doesn't always draw
eric.carlson@apple.com [Mon, 10 Nov 2014 18:35:17 +0000 (18:35 +0000)]
[iOS] wireless playback placeholder UI doesn't always draw
https://bugs.webkit.org/show_bug.cgi?id=138548

While it is important to only listen for the 'webkitplaybacktargetavailabilitychanged' event
when we are displaying inline controls because listening for it increases power consumption,
we should always listen for the 'webkitcurrentplaybacktargetiswirelesschanged' event because
it controls whether or not we draw the placeholder UI which is always visible during wireless
playback.

Reviewed by Brent Fulgham.

* Modules/mediacontrols/mediaControlsiOS.js:
(ControllerIOS.prototype.addVideoListeners): Always listen for the
    'webkitcurrentplaybacktargetiswirelesschanged' event.
(ControllerIOS.prototype.removeVideoListeners): Always stop listening for the
    'webkitcurrentplaybacktargetiswirelesschanged' event.
(ControllerIOS.prototype.handleStartPlaybackButtonTouchEnd): Call updateControls so we update
    the type of controls rendered and start listening for wireless target changes immediately.
(ControllerIOS.prototype.setShouldListenForPlaybackTargetAvailabilityEvent): Don't start and stop
    listening for 'webkitcurrentplaybacktargetiswirelesschanged', we should always listen for it.

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

6 years agoiOS build fix.
mitz@apple.com [Mon, 10 Nov 2014 18:04:27 +0000 (18:04 +0000)]
iOS build fix.

* UIProcess/ios/RemoteLayerTreeHostIOS.mm:
(WebKit::RemoteLayerTreeHost::createLayer):

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

6 years agoRemove BloomFilter size limit
antti@apple.com [Mon, 10 Nov 2014 17:05:28 +0000 (17:05 +0000)]
Remove BloomFilter size limit
https://bugs.webkit.org/show_bug.cgi?id=138549

Reviewed by Andreas Kling.

* wtf/BloomFilter.h: Remove the static_assert, the code works fine with somewhat larger sizes.

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

6 years agoCrash in WebCore::Node::getFlag
ossy@webkit.org [Mon, 10 Nov 2014 16:20:43 +0000 (16:20 +0000)]
Crash in WebCore::Node::getFlag
https://bugs.webkit.org/show_bug.cgi?id=137961

Reviewed by Antti Koivisto.

Source/WebCore:

* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::applyBlockStyle): Null pointer check added.

LayoutTests:

* editing/execCommand/crash-137961-expected.txt: Added.
* editing/execCommand/crash-137961.html: Added.

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

6 years ago[EFL] Fix the test font path after r175555.
ossy@webkit.org [Mon, 10 Nov 2014 15:37:29 +0000 (15:37 +0000)]
[EFL] Fix the test font path after r175555.

Patch by Eva Balazsfalvi <evab.u-szeged@partner.samsung.com> on 2014-11-10
Reviewed by Csaba Osztrogonác.

* WebKitTestRunner/PlatformEfl.cmake: Dependencies -> DependenciesEFL

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

6 years agoASSERTION FAILED: !object || !object->parent()->isRuby() || is<RenderRubyRun>(*object...
mihnea@adobe.com [Mon, 10 Nov 2014 14:58:52 +0000 (14:58 +0000)]
ASSERTION FAILED: !object || !object->parent()->isRuby() || is<RenderRubyRun>(*object) || (object->isInline() && (object->isBeforeContent() || object->isAfterContent())) || (object->isAnonymous() && ... ) in WebCore::isAnonymousRubyInlineBlock
https://bugs.webkit.org/show_bug.cgi?id=137958

Reviewed by Chris Dumez.

Source/WebCore:

When a ruby element, with block behavior, dynamically changes its style
from multicol to without multicol, we have to remove its special children,
RenderMultiColumnFlowThread and RenderMultiColumnSet, the normal way using
the method in RenderBlockFlow base class. This patch adds both
RenderMultiColumnFlowThread and RenderMultiColumnSet to the list of RenderRuby
children removed normally and adds a new function - isRubyChildForNormalRemove -
to test the condition and use it in the assertion in RenderRuby*::removeChild
method.

Test: fast/multicol/newmulticol/ruby-from-multicol-to-auto.html

* rendering/RenderRuby.cpp:
(WebCore::isRubyChildForNormalRemove):
(WebCore::RenderRubyAsInline::removeChild):
(WebCore::RenderRubyAsBlock::removeChild):

LayoutTests:

* fast/multicol/newmulticol/ruby-from-multicol-to-auto-expected.txt: Added.
* fast/multicol/newmulticol/ruby-from-multicol-to-auto.html: Added.

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

6 years ago[WK2] Use C++ lambdas in IPC::Connection
zandobersek@gmail.com [Mon, 10 Nov 2014 12:29:57 +0000 (12:29 +0000)]
[WK2] Use C++ lambdas in IPC::Connection
https://bugs.webkit.org/show_bug.cgi?id=138018

Reviewed by Anders Carlsson.

Replace uses of WTF::bind() in the IPC::Connection class with C++11 lambdas.

* Platform/IPC/Connection.cpp:
(IPC::Connection::SyncMessageState::processIncomingMessage):
(IPC::Connection::dispatchWorkQueueMessageReceiverMessage):
(IPC::Connection::invalidate):
(IPC::Connection::sendMessage):
(IPC::Connection::processIncomingMessage):
(IPC::Connection::enqueueIncomingMessage):
* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::initializeDeadNameSource):
(IPC::Connection::receiveSourceEventHandler):
* Platform/IPC/unix/ConnectionUnix.cpp:
(IPC::Connection::open):

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

6 years ago[EFL] Add missing test results since r169631, r174992
commit-queue@webkit.org [Mon, 10 Nov 2014 10:48:30 +0000 (10:48 +0000)]
[EFL] Add missing test results since r169631, r174992
https://bugs.webkit.org/show_bug.cgi?id=138502

Patch by Sanghyup Lee <sh53.lee@samsung.com> on 2014-11-10
Reviewed by Gyuyoung Kim.

* platform/efl/accessibility/aria-inherits-presentational-expected.txt: Added.
* platform/efl/accessibility/css-content-attribute-expected.txt: Added.

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

6 years agoEnable Cortex-A53-specific code paths by default if core is detected.
commit-queue@webkit.org [Mon, 10 Nov 2014 10:38:09 +0000 (10:38 +0000)]
Enable Cortex-A53-specific code paths by default if core is detected.
https://bugs.webkit.org/show_bug.cgi?id=138499

Patch by Akos Kiss <akiss@inf.u-szeged.hu> on 2014-11-10
Reviewed by Csaba Osztrogonác.

On ARM64/Linux, check /proc/cpuinfo for CPU part 0xd03 (signaling
Cortex-A53) and set the initial value of WTF_CPU_ARM64_CORTEXA53 to true
if found.

Since on ARM64/Linux the part number that cpuinfo reports depends on
the core the query is run on, the check is bound to and executed on the
available cores one by one.

* Source/cmake/OptionsCommon.cmake:

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

6 years ago[EFL] Remove unnecessary version check from OptionsEfl.cmake
evab.u-szeged@partner.samsung.com [Mon, 10 Nov 2014 09:09:44 +0000 (09:09 +0000)]
[EFL] Remove unnecessary version check from OptionsEfl.cmake
https://bugs.webkit.org/show_bug.cgi?id=138498

Reviewed by Csaba Osztrogonác.

* Source/cmake/OptionsEfl.cmake:

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

6 years agoFix 'noreturn' function does return warning in LLVMOverrides.cpp
commit-queue@webkit.org [Mon, 10 Nov 2014 08:00:36 +0000 (08:00 +0000)]
Fix 'noreturn' function does return warning in LLVMOverrides.cpp
https://bugs.webkit.org/show_bug.cgi?id=138306

Patch by Akos Kiss <akiss@inf.u-szeged.hu> on 2014-11-09
Reviewed by Filip Pizlo.

Adding NO_RETURN where needed.

* llvm/library/LLVMExports.cpp:
(initializeAndGetJSCLLVMAPI):
* llvm/library/LLVMOverrides.cpp:
* llvm/library/LLVMTrapCallback.h:

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

6 years agoFix the exception fuzz helper to generate targets in the correct range
commit-queue@webkit.org [Mon, 10 Nov 2014 07:59:26 +0000 (07:59 +0000)]
Fix the exception fuzz helper to generate targets in the correct range
https://bugs.webkit.org/show_bug.cgi?id=138544

Patch by Akos Kiss <akiss@inf.u-szeged.hu> on 2014-11-10
Reviewed by Filip Pizlo.

Currently, the script generates exception fuzz targets in the range of
0..($checkCount-1). However, target 0 is never hit, while target 1 is
always outside of the outermost try block of the tests, which therefore
prints unexpected output and results in false failures when fired at.
Additionally, target $checkCount is never generated.

This patch fixes the script to generate targets in the range of
2..$checkCount.

* Scripts/jsc-stress-test-helpers/js-exception-fuzz:

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

6 years ago[EFL] Remove GamepadDeviceEfl::create()
gyuyoung.kim@samsung.com [Mon, 10 Nov 2014 06:52:30 +0000 (06:52 +0000)]
[EFL] Remove GamepadDeviceEfl::create()
https://bugs.webkit.org/show_bug.cgi?id=138553

Reviewed by Darin Adler.

As a step to use std::unique_ptr<> and std::make_unique<>, this patch removes GamepadDeviceEfl::create().
Instead we use std::make_unique<>.

No new tests, no behavior changes.

* platform/efl/GamepadsEfl.cpp:
(WebCore::GamepadsEfl::registerDevice):
(WebCore::GamepadDeviceEfl::create): Deleted.
(WebCore::GamepadsEfl::unregisterDevice): Deleted.

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

6 years agoRemove create() factory function in FooAnimationValue classes
gyuyoung.kim@samsung.com [Mon, 10 Nov 2014 06:46:54 +0000 (06:46 +0000)]
Remove create() factory function in FooAnimationValue classes
https://bugs.webkit.org/show_bug.cgi?id=138206

Reviewed by Darin Adler.

As a step to use std::unique_ptr and std::make_unique, this patch removes create()
factory function in FooAnimationValue classes. As this changes, FooAnimationValue::create()
are changed to std::make_unique<>.

Source/WebCore:

No new tests, no behavior changes.

* platform/graphics/GraphicsLayer.cpp:
(WebCore::KeyframeValueList::insert):
* platform/graphics/GraphicsLayer.h:
(WebCore::FloatAnimationValue::FloatAnimationValue):
(WebCore::TransformAnimationValue::TransformAnimationValue):
(WebCore::FilterAnimationValue::FilterAnimationValue):
(WebCore::FloatAnimationValue::create): Deleted.
(WebCore::TransformAnimationValue::create): Deleted.
(WebCore::FilterAnimationValue::create): Deleted.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::startAnimation):
(WebCore::RenderLayerBacking::startTransition):

Source/WebKit2:

* Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
(IPC::ArgumentCoder<GraphicsLayerAnimation>::decode):
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
(WebKit::WebInspectorClient::showPaintRect):

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

6 years agomake-passwords-json.py should generarate everything needed for testing
ossy@webkit.org [Mon, 10 Nov 2014 06:11:47 +0000 (06:11 +0000)]
make-passwords-json.py should generarate everything needed for testing
https://bugs.webkit.org/show_bug.cgi?id=138503

Reviewed by Ryosuke Niwa.

* BuildSlaveSupport/build.webkit.org-config/make_passwords_json.py:
Renamed from make-passwords-json.py to be able included from mastercfg_unittest.py.
Additionally generate auth.json, credentials.cfg and committers.cfg too.
(create_mock_slave_passwords_dict): Moved from mastercfg_unittest.py
* BuildSlaveSupport/build.webkit.org-config/mastercfg_unittest.py:
(BuildBotConfigLoader._mock_open): Use make_passwords_json.create_mock_slave_passwords_dict() to avoid duplication.
(BuildBotConfigLoader._create_mock_passwords_dict): Deleted.

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

6 years agoUnreviewed, fix typo in r175796.
cdumez@apple.com [Mon, 10 Nov 2014 05:48:35 +0000 (05:48 +0000)]
Unreviewed, fix typo in r175796.

Rename areEssentialEqualAsFloat to areEssentiallyEqualAsFloat.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::areEssentiallyEqualAsFloat):
(WebKit::WebPage::dynamicViewportSizeUpdate):
(WebKit::areEssentialEqualAsFloat): Deleted.

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

6 years agoAdd a more correct way to compare floating point numbers and use it
cdumez@apple.com [Mon, 10 Nov 2014 00:21:56 +0000 (00:21 +0000)]
Add a more correct way to compare floating point numbers and use it
https://bugs.webkit.org/show_bug.cgi?id=138527

Reviewed by Darin Adler.

Source/WebCore:

Use the new WTF::areEssentuallyEqual() utility function from MathExtras.h
to compare floating-point numbers.

No new tests, no behavior change.

* page/DOMTimer.cpp:
(WebCore::DOMTimer::updateTimerIntervalIfNecessary):
* platform/graphics/FloatQuad.cpp:
(WebCore::FloatQuad::isRectilinear):
* platform/graphics/FloatRoundedRect.cpp:
(WebCore::FloatRoundedRect::Radii::isUniformCornerRadius):
* platform/graphics/FloatSize.h:
(WebCore::areEssentiallyEqual):
(WebCore::withinEpsilon): Deleted.

Source/WebKit/mac:

Use the new WTF::areEssentuallyEqual() utility function from MathExtras.h
to compare floating-point numbers.

* WebView/WebHTMLView.mm:
(-[WebHTMLView _adjustedBottomOfPageWithTop:bottom:limit:]):

Source/WebKit2:

Use the new WTF::areEssentuallyEqual() utility function from MathExtras.h
to compare floating-point numbers.

* UIProcess/API/Cocoa/WKWebView.mm:
(withinEpsilon):
* UIProcess/CoordinatedGraphics/PageViewportController.cpp:
(WebKit::PageViewportController::updateMinimumScaleToFit):
(WebKit::fuzzyCompare): Deleted.
* UIProcess/CoordinatedGraphics/PageViewportController.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::withinEpsilon):

* UIProcess/API/Cocoa/WKWebView.mm:
(areEssentiallyEqualAsFloat):
(-[WKWebView _didCommitLayerTree:]):
(withinEpsilon): Deleted.
* UIProcess/CoordinatedGraphics/PageViewportController.cpp:
(WebKit::PageViewportController::updateMinimumScaleToFit):
(WebKit::fuzzyCompare): Deleted.
* UIProcess/CoordinatedGraphics/PageViewportController.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::areEssentialEqualAsFloat):
(WebKit::WebPage::dynamicViewportSizeUpdate):
(WebKit::withinEpsilon): Deleted.

Source/WTF:

To compare floating point numbers in the code base, we would often rely
on the following check:
std::abs(a - b) <= std::numeric_limits<T>::epsilon()

However, this is not correct for arbitrary floating point values, and
will fail for values that are not close to zero.

This patch introduces a WTF::areEssentiallyEqual() templated function
that can only be called with floating point types and relies on the
following formula from [1][2] that defines u as being "essentially
equal" to v if: | u - v | / |u| <= e and | u - v | / |v| <= e

[1] Knuth, D. E. "Accuracy of Floating Point Arithmetic." The Art of
    Computer Programming. 3rd ed. Vol. 2. Boston: Addison-Wesley, 1998.
    229-45.
[2] http://www.boost.org/doc/libs/1_34_0/libs/test/doc/components/test_tools/floating_point_comparison.html

* wtf/MathExtras.h:
(WTF::safeFPDivision):
(WTF::areEssentiallyEqual):
(WTF::withinEpsilon): Deleted.

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

6 years agoPut bug link at the start of the line.
simon.fraser@apple.com [Sun, 9 Nov 2014 19:46:24 +0000 (19:46 +0000)]
Put bug link at the start of the line.

* platform/mac-wk2/TestExpectations:

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

6 years agoImplement round-rect clipping on video elements
simon.fraser@apple.com [Sun, 9 Nov 2014 19:42:17 +0000 (19:42 +0000)]
Implement round-rect clipping on video elements
https://bugs.webkit.org/show_bug.cgi?id=138537
rdar://problem/9534399

Reviewed by Darin Adler.
Source/WebCore:

Support border-radius on video and other layers with composited contents,
by pushing a FloatRoundedRect onto the GraphicsLayer as the contentsClippingRect,
and, on Mac, using layer corner-radius or a CAShapeLayer mask.

Test: compositing/video/video-border-radius.html

* WebCore.exp.in:
* platform/graphics/FloatRoundedRect.cpp:
(WebCore::FloatRoundedRect::Radii::isUniformCornerRadius): Returns true if all
corner radii are the same, and have equal widths and heights.
* platform/graphics/FloatRoundedRect.h: Allow construction without an explicit
rect.
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::GraphicsLayer): nullptr goodness.
(showGraphicsLayerTree): Print contents layers when debugging.
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::contentsClippingRect): Make this take a FloatRoundedRect.
(WebCore::GraphicsLayer::setContentsClippingRect):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::setContentsClippingRect):
(WebCore::GraphicsLayerCA::setContentsToSolidColor):
(WebCore::GraphicsLayerCA::setContentsToImage):
(WebCore::GraphicsLayerCA::setContentsToPlatformLayer):
(WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
(WebCore::GraphicsLayerCA::updateClippingStrategy): Determines whether we can simply
use corner-radius on the existing contentsClippingLayer, or whether we have to
create a shape layer to use as a mask.
(WebCore::GraphicsLayerCA::updateContentsRects): We have to add/remove the shape layer
based on the rounded rect radii. Calls updateClippingStrategy() on the clipping layer,
and also updates clones accordingly.
(WebCore::dumpInnerLayer):
(WebCore::GraphicsLayerCA::dumpAdditionalProperties): Dump all the inner layers
(requiring on test rebaseline), including the new shape and backdrop layers.
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/ca/PlatformCALayer.h: Add a new shape layer type.
* platform/graphics/ca/mac/PlatformCALayerMac.h: Support for corner radius and
a rounded rect shape mask.
* platform/graphics/ca/mac/PlatformCALayerMac.mm:
(PlatformCALayerMac::PlatformCALayerMac):
(PlatformCALayerMac::clone):
(PlatformCALayerMac::setMask):
(PlatformCALayerMac::cornerRadius):
(PlatformCALayerMac::setCornerRadius):
(PlatformCALayerMac::shapeRoundedRect):
(PlatformCALayerMac::setShapeRoundedRect):
* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(PlatformCALayerWin::cornerRadius):
(PlatformCALayerWin::setCornerRadius):
(PlatformCALayerWin::shapeRoundedRect):
(PlatformCALayerWin::setShapeRoundedRect):
* platform/graphics/ca/win/PlatformCALayerWin.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::resetContentsRect): Use getRoundedInnerBorderFor() to get
the rounded rect used to clip contents.
(WebCore::RenderLayerBacking::positionOverflowControlsLayers): Push a FloatRoundedRect for the contents clip,
(WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundColor): Ditto.
(WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundImage): Ditto.
(WebCore::RenderLayerBacking::updateImageContents): Get the rounded rect clip.
* rendering/RenderLayerBacking.h: nullptr.

Source/WebKit2:

Support border-radius on video and other layers with composited contents,
by pushing a FloatRoundedRect onto the GraphicsLayer as the contentsClippingRect,
and, on Mac, using layer corner-radius or a CAShapeLayer mask.

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<FloatRoundedRect>::encode):
(IPC::ArgumentCoder<FloatRoundedRect>::decode):
* Shared/WebCoreArgumentCoders.h:
* Shared/mac/RemoteLayerBackingStore.mm: New shape layer type.
(WebKit::RemoteLayerBackingStore::drawInContext):
* Shared/mac/RemoteLayerTreePropertyApplier.mm:
(WebKit::applyPropertiesToLayer): Apply corner-radius and shape path.
* Shared/mac/RemoteLayerTreeTransaction.h: Prettify the flags. Yes, I prefer this style.
* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
(WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
(WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
(WebKit::RemoteLayerTreeTextStream::operator<<):
(WebKit::dumpChangedLayers):
(WebKit::RemoteLayerTreeTransaction::description):
* UIProcess/ios/RemoteLayerTreeHostIOS.mm:
(+[WKShapeView layerClass]): Make UIViews with a CAShapeLayer layer class.
(WebKit::RemoteLayerTreeHost::createLayer):
* UIProcess/mac/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::createLayer):
* WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::updateClonedLayerProperties):
(WebKit::isEquivalentLayer):
(WebKit::PlatformCALayerRemote::setMask):
(WebKit::PlatformCALayerRemote::setClonedLayer):
(WebKit::PlatformCALayerRemote::cornerRadius):
(WebKit::PlatformCALayerRemote::setCornerRadius):
(WebKit::PlatformCALayerRemote::shapeRoundedRect):
(WebKit::PlatformCALayerRemote::setShapeRoundedRect):
* WebProcess/WebPage/mac/PlatformCALayerRemote.h:

LayoutTests:

Test that uses clip() to compare a bit of rounded-rect video in the corner.
Rebaselined test that dumped contents layers.

* compositing/video/video-border-radius-expected.html: Added.
* compositing/video/video-border-radius.html: Added.
* platform/mac/compositing/reflections/direct-image-object-fit-reflected-expected.txt:

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

6 years ago[GTK] generate-gtkdoc should ignore invalid files
carlosgc@webkit.org [Sun, 9 Nov 2014 18:27:56 +0000 (18:27 +0000)]
[GTK] generate-gtkdoc should ignore invalid files
https://bugs.webkit.org/show_bug.cgi?id=138542

Reviewed by Darin Adler.

* gtk/generate-gtkdoc:
(files_to_ignore.file_should_be_ignored): Return True to ignore
invalid files.

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

6 years agoFix various cases of incorrect cross-thread capture of non-thread-safe RefCounted
darin@apple.com [Sun, 9 Nov 2014 17:25:21 +0000 (17:25 +0000)]
Fix various cases of incorrect cross-thread capture of non-thread-safe RefCounted
https://bugs.webkit.org/show_bug.cgi?id=138539

Reviewed by Alexey Proskuryakov.

* Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
(WebCore::WorkerThreadableWebSocketChannel::Peer::didConnect): Use StringCapture
instead of isolatedCopy, to avoid a problem where the original thread does its deref
after passing the string to the other thread.
(WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveMessage): Ditto.
(WebCore::WorkerThreadableWebSocketChannel::Peer::didClose): Ditto.
(WebCore::WorkerThreadableWebSocketChannel::Bridge::initialize): Ditto.
(WebCore::WorkerThreadableWebSocketChannel::Bridge::connect): Ditto.
(WebCore::WorkerThreadableWebSocketChannel::Bridge::send): Ditto.
(WebCore::WorkerThreadableWebSocketChannel::Bridge::close): Ditto.
(WebCore::WorkerThreadableWebSocketChannel::Bridge::fail): Ditto.

* dom/Document.cpp:
(WebCore::Document::addConsoleMessage): Pass a StringCapture when creating
AddConsoleMessageTask. Same reason as above, but in a different context.
(WebCore::Document::addMessage): Ditto.

* dom/ScriptExecutionContext.h: Changed AddConsoleMessageTask to take and
capture a StringCapture rather than a String, for the same reason as above.

* fileapi/AsyncFileStream.cpp:
(WebCore::AsyncFileStream::write): Use URLCapture instead of trying to use
StringCapture on a URL, since that doesn't preserve the validity flag.

* loader/WorkerThreadableLoader.cpp:
(WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge): Use StringCapture.
(WebCore::WorkerThreadableLoader::MainThreadBridge::didFail): Ditto.
(WebCore::WorkerThreadableLoader::MainThreadBridge::didFailAccessControlCheck): Ditto.

* platform/URL.h: Added URLCapture.

* platform/network/FormData.cpp:
(WebCore::appendBlobResolved): Remove incorrect pointless code that creates a new URL
from an existing URL with the ParsedURLString constructor.

* workers/DefaultSharedWorkerRepository.cpp: Fixed code that was trying to copy a URL
by copying a string to instead just use URL::copy. The comment claimed that URL::copy
is not thread safe, but that claim is incorrect.
(WebCore::SharedWorkerProxy::postExceptionToWorkerObject): Use StringCapture.
(WebCore::SharedWorkerProxy::postConsoleMessageToWorkerObject): Ditto.
(WebCore::DefaultSharedWorkerRepository::getProxy): Use URL::copy.

* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::addConsoleMessage): Use StringCapture.
(WebCore::WorkerGlobalScope::addMessage): Ditto.
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::postExceptionToWorkerObject): Ditto.
(WebCore::WorkerMessagingProxy::postConsoleMessageToWorkerObject): Ditto.
(WebCore::WorkerMessagingProxy::sendMessageToInspector): Ditto.
(WebCore::WorkerMessagingProxy::postMessageToPageInspector): Ditto.

* workers/WorkerRunLoop.cpp:
(WebCore::WorkerRunLoop::postTaskAndTerminate): Make a Task with make_unique
rather than with Task::create. Removed an extra isolatedCopy, unneeded because
the Task constructor already does an isolatedCopy.
(WebCore::WorkerRunLoop::postTaskForMode): Ditto.
(WebCore::WorkerRunLoop::Task::create): Deleted.

* workers/WorkerRunLoop.h: Removed unneeded create function and explicit
public empty destructor.

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

6 years agoUse is<>() / downcast<>() for HTMLCollection subclasses
cdumez@apple.com [Sun, 9 Nov 2014 17:21:51 +0000 (17:21 +0000)]
Use is<>() / downcast<>() for HTMLCollection subclasses
https://bugs.webkit.org/show_bug.cgi?id=138541

Reviewed by Sam Weinig.

Use is<>() / downcast<>() for HTMLCollection subclasses for
safety and consistency with the rest of the code base.

No new tests, no behavior change.

* bindings/gobject/WebKitDOMPrivate.cpp:
(WebKit::wrap):
* html/HTMLAllCollection.h:
* html/HTMLCollection.cpp:
(WebCore::isMatchingHTMLElement):
(WebCore::isMatchingElement):
* html/HTMLCollection.h:
* html/HTMLFormControlsCollection.h:
* html/HTMLNameCollection.h:
* html/HTMLOptionsCollection.h:
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::options):
* html/HTMLTableRowsCollection.h:

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

6 years agoMove _ignoresNonWheelMouseEvents implementation to WKView(Private)
commit-queue@webkit.org [Sun, 9 Nov 2014 10:12:14 +0000 (10:12 +0000)]
Move _ignoresNonWheelMouseEvents implementation to WKView(Private)
https://bugs.webkit.org/show_bug.cgi?id=138487

Patch by Conrad Shultz <conrad_shultz@apple.com> on 2014-11-09
Reviewed by Dan Bernstein.

Relocate some methods that should have been in a category implementation.

* UIProcess/API/mac/WKView.mm:
(-[WKView _setIgnoresNonWheelMouseEvents:]):
(-[WKView _ignoresNonWheelMouseEvents]):

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

6 years agohttp/tests/xmlhttprequest/cross-origin-cookie-storage.html fails with PPT.
ap@apple.com [Sun, 9 Nov 2014 06:32:47 +0000 (06:32 +0000)]
http/tests/xmlhttprequest/cross-origin-cookie-storage.html fails with PPT.

This test used to pass because some previous test leaked a cookie. Now that we
clear cookies between tests, it fails, and will fail until we implement testRunner.setAlwaysAcceptCookies.

* platform/mac-wk2/TestExpectations:

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

6 years agoCall faster HTMLElement::hasTagName() in HTMLCollection
cdumez@apple.com [Sun, 9 Nov 2014 05:59:52 +0000 (05:59 +0000)]
Call faster HTMLElement::hasTagName() in HTMLCollection
https://bugs.webkit.org/show_bug.cgi?id=138529

Reviewed by Darin Adler.

Call faster HTMLElement::hasTagName() in HTMLCollection instead of
slower Node::hasTagName() by restructuring the code a bit to
distinguish collection that deal only with HTMLElements from others.

No new tests, no behavior change.

* html/HTMLCollection.cpp:
(WebCore::isMatchingHTMLElement):
(WebCore::isMatchingElement):

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

6 years agoMove isEmptyValue() logic from HTMLInputElement to TextFieldInputType
cdumez@apple.com [Sun, 9 Nov 2014 05:46:59 +0000 (05:46 +0000)]
Move isEmptyValue() logic from HTMLInputElement to TextFieldInputType
https://bugs.webkit.org/show_bug.cgi?id=138538

Reviewed by Darin Adler.

Move isEmptyValue() logic from HTMLInputElement to TextFieldInputType
as this only makes sense for text field input types.

No new tests, no behavior change.

* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::isEmptyValue):
* html/InputType.cpp:
(WebCore::InputType::isEmptyValue):
* html/InputType.h:
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::isEmptyValue):
* html/TextFieldInputType.h:

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

6 years agoFix Ember.js warnings the new perf dashboard
rniwa@webkit.org [Sun, 9 Nov 2014 03:21:13 +0000 (03:21 +0000)]
Fix Ember.js warnings the new perf dashboard
https://bugs.webkit.org/show_bug.cgi?id=138531

Reviewed by Darin Adler.

Fixed various warnings.

* public/v2/app.js:
(App.InteractiveChartComponent._relayoutDataAndAxes): We can't use "rem". Use this._rem as done for x.
* public/v2/data.js:
(PrivilegedAPI._post): Removed the superfluous console.log.
(CommitLogs.fetchForTimeRange): Ditto.
* public/v2/index.html: Added tbody as required by the HTML specification.

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

6 years agohttp/tests/navigation/redirect-on-back-updates-history-item.html leaks a cookie
ap@apple.com [Sun, 9 Nov 2014 03:18:40 +0000 (03:18 +0000)]
http/tests/navigation/redirect-on-back-updates-history-item.html leaks a cookie
https://bugs.webkit.org/show_bug.cgi?id=138507

Reviewed by Pratik Solanki.

* http/tests/navigation/resources/redirect-updates-history-item-done.html:

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

6 years agoWeb Inspector: decouple child element folderization logic from FrameTreeElement
commit-queue@webkit.org [Sun, 9 Nov 2014 03:17:40 +0000 (03:17 +0000)]
Web Inspector: decouple child element folderization logic from FrameTreeElement
https://bugs.webkit.org/show_bug.cgi?id=138364

Patch by Matt Baker <mattbaker@apple.com> on 2014-11-08
Reviewed by Timothy Hatcher.

Created FolderizedTreeElement base class, which FrameTreeElement now inherits via SourceCodeTreeElement.
FolderizedTreeElement uses settings provided by derived classes for labeling subfolders and to determine
folder membership for child items.

* UserInterface/Base/Main.js:
(WebInspector.canArchiveMainFrame):
* UserInterface/Main.html:
* UserInterface/Models/LayoutTimelineRecord.js:
(WebInspector.LayoutTimelineRecord.displayNameForEventType):
(WebInspector.LayoutTimelineRecord.EventType.displayName): Deleted.
* UserInterface/Models/Resource.js:
(WebInspector.Resource):
(WebInspector.Resource.typeFromMIMEType):
(WebInspector.Resource.displayNameForType):
(WebInspector.Resource.prototype.get syntheticMIMEType):
(WebInspector.Resource.prototype.updateForResponse):
(WebInspector.Resource.Type.fromMIMEType): Deleted.
(WebInspector.Resource.Type.displayName): Deleted.
* UserInterface/Models/SourceMapResource.js:
(WebInspector.SourceMapResource):
* UserInterface/Views/FolderizedTreeElement.js: Added.
(WebInspector.FolderizedTreeElement):
(WebInspector.FolderizedTreeElement.prototype.get groupedIntoFolders):
(WebInspector.FolderizedTreeElement.prototype.set folderSettingsKey):
(WebInspector.FolderizedTreeElement.prototype.registerFolderizeSettings):
(WebInspector.FolderizedTreeElement.prototype.set removeChildren):
(WebInspector.FolderizedTreeElement.prototype.addChildForRepresentedObject):
(WebInspector.FolderizedTreeElement.prototype.addRepresentedObjectToNewChildQueue):
(WebInspector.FolderizedTreeElement.prototype.removeChildForRepresentedObject):
(WebInspector.FolderizedTreeElement.prototype.compareChildTreeElements):
(WebInspector.FolderizedTreeElement.prototype.updateParentStatus):
(WebInspector.FolderizedTreeElement.prototype._clearNewChildQueue):
(WebInspector.FolderizedTreeElement.prototype._populateFromNewChildQueue):
(WebInspector.FolderizedTreeElement.prototype._removeRepresentedObjectFromNewChildQueue):
(WebInspector.FolderizedTreeElement.prototype._addTreeElement):
(WebInspector.FolderizedTreeElement.prototype._compareTreeElementsByMainTitle):
(WebInspector.FolderizedTreeElement.prototype._insertFolderTreeElement):
(WebInspector.FolderizedTreeElement.prototype._insertChildTreeElement):
(WebInspector.FolderizedTreeElement.prototype._removeTreeElement):
(WebInspector.FolderizedTreeElement.prototype._parentTreeElementForRepresentedObject):
(WebInspector.FolderizedTreeElement.prototype._folderTreeElementExpandedStateChange):
(WebInspector.FolderizedTreeElement.prototype._settingsForRepresentedObject):
(WebInspector.FolderizedTreeElement.prototype._shouldGroupIntoFolders.pushCategory):
(WebInspector.FolderizedTreeElement.prototype._shouldGroupIntoFolders):
* UserInterface/Views/FrameTreeElement.js:
(.this):
(WebInspector.FrameTreeElement.prototype.updateSourceMapResources):
(WebInspector.FrameTreeElement.prototype.onattach):
(WebInspector.FrameTreeElement.prototype.ondetach):
(WebInspector.FrameTreeElement.prototype.compareChildTreeElements):
(WebInspector.FrameTreeElement.prototype.onpopulate):
(WebInspector.FrameTreeElement.prototype._mainResourceDidChange):
(WebInspector.FrameTreeElement.prototype._resourceWasAdded):
(WebInspector.FrameTreeElement.prototype._resourceWasRemoved):
(WebInspector.FrameTreeElement.prototype._childFrameWasAdded):
(WebInspector.FrameTreeElement.prototype._childFrameWasRemoved):
(WebInspector.FrameTreeElement.prototype._childContentFlowWasAdded):
(WebInspector.FrameTreeElement.prototype._childContentFlowWasRemoved):
(WebInspector.FrameTreeElement.prototype._rootDOMNodeInvalidated):
(WebInspector.FrameTreeElement): Deleted.
(WebInspector.FrameTreeElement.prototype.removeChildren): Deleted.
(WebInspector.FrameTreeElement.prototype._updateParentStatus): Deleted.
(WebInspector.FrameTreeElement.prototype._addRepresentedObjectToNewChildQueue): Deleted.
(WebInspector.FrameTreeElement.prototype._removeRepresentedObjectFromNewChildQueue): Deleted.
(WebInspector.FrameTreeElement.prototype._populateFromNewChildQueue): Deleted.
(WebInspector.FrameTreeElement.prototype._clearNewChildQueue): Deleted.
(WebInspector.FrameTreeElement.prototype._addChildForRepresentedObject): Deleted.
(WebInspector.FrameTreeElement.prototype._removeChildForRepresentedObject): Deleted.
(WebInspector.FrameTreeElement.prototype._addTreeElementForRepresentedObject): Deleted.
(WebInspector.FrameTreeElement.prototype._addTreeElement): Deleted.
(WebInspector.FrameTreeElement.prototype._compareTreeElementsByMainTitle): Deleted.
(WebInspector.FrameTreeElement.prototype._insertFolderTreeElement): Deleted.
(WebInspector.FrameTreeElement.prototype._compareResourceTreeElements): Deleted.
(WebInspector.FrameTreeElement.prototype._insertResourceTreeElement): Deleted.
(WebInspector.FrameTreeElement.prototype._removeTreeElement): Deleted.
(WebInspector.FrameTreeElement.prototype._folderNameForResourceType): Deleted.
(WebInspector.FrameTreeElement.prototype._parentTreeElementForRepresentedObject.createFolderTreeElement): Deleted.
(WebInspector.FrameTreeElement.prototype._parentTreeElementForRepresentedObject): Deleted.
(WebInspector.FrameTreeElement.prototype._folderTreeElementExpandedStateChange): Deleted.
(WebInspector.FrameTreeElement.prototype._shouldGroupIntoFolders.pushResourceType): Deleted.
(WebInspector.FrameTreeElement.prototype._shouldGroupIntoFolders.pushCategory): Deleted.
(WebInspector.FrameTreeElement.prototype._shouldGroupIntoFolders): Deleted.
* UserInterface/Views/LayoutTimelineDataGridNode.js:
(WebInspector.LayoutTimelineDataGridNode.prototype.createCellContent):
* UserInterface/Views/LayoutTimelineView.js:
(WebInspector.LayoutTimelineView): Deleted.
* UserInterface/Views/NetworkTimelineView.js:
(WebInspector.NetworkTimelineView): Deleted.
* UserInterface/Views/ResourceDetailsSidebarPanel.js:
(WebInspector.ResourceDetailsSidebarPanel.prototype._refreshResourceType):
* UserInterface/Views/ResourceTimelineDataGridNode.js:
(WebInspector.ResourceTimelineDataGridNode.prototype.createCellContent):
* UserInterface/Views/SourceCodeTreeElement.js:
(WebInspector.SourceCodeTreeElement):
* UserInterface/Views/TimelineDataGrid.js:
(WebInspector.TimelineDataGrid.createColumnScopeBar):
* UserInterface/Views/TimelineRecordTreeElement.js:
(WebInspector.TimelineRecordTreeElement):
* WebInspectorUI.vcxproj/WebInspectorUI.vcxproj:
* WebInspectorUI.vcxproj/WebInspectorUI.vcxproj.filters:

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

6 years agoDelete cookies between tests
ap@apple.com [Sun, 9 Nov 2014 03:17:02 +0000 (03:17 +0000)]
Delete cookies between tests
https://bugs.webkit.org/show_bug.cgi?id=138528

Reviewed by Sam Weinig.

Source/WebKit/mac:

* WebView/WebPreferences.mm: (+[WebPreferences _clearNetworkLoaderSession]):
* WebView/WebPreferencesPrivate.h:
Added an SPI for DumpRenderTree.

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm:
(resetWebPreferencesToConsistentValues):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):
Do it.

* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::beginTesting):
Added a FIXME.

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

6 years agoReplace FileThread class with a single function
darin@apple.com [Sun, 9 Nov 2014 01:01:22 +0000 (01:01 +0000)]
Replace FileThread class with a single function
https://bugs.webkit.org/show_bug.cgi?id=138282

Reviewed by Alexey Proskuryakov.

Source/WebCore:

* CMakeLists.txt: Removed FileThread.cpp.

* WebCore.vcxproj/WebCore.vcxproj: Removed FileThread.cpp/.h.
* WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
* WebCore.xcodeproj/project.pbxproj: Ditto.

* bindings/generic/ActiveDOMCallback.cpp: Removed unneeded includes.
* dom/ActiveDOMObject.cpp: Ditto.

* fileapi/AsyncFileStream.cpp:
(WebCore::callOnFileThread): Added. Implements the file thread.
(WebCore::AsyncFileStream::AsyncFileStream): Take a reference to the client.
Make m_internals. Use the destroyed flag instead of trickier techniques to
handle stopping. Once the stream is destroyed, there will be no further callbacks.
(WebCore::AsyncFileStream::~AsyncFileStream): Added assertions and merged in the
stop behavior here. This class no longer requires an explicit stop function.
(WebCore::AsyncFileStream::perform): Added. Helper used for all the operations
below. Takes a function that performs an operation and then returns a client
callback function. Respects the m_stopped boolean on the file thread (so we
don't do extra operations) and on the client thread (so we are guaranteed not
to get any client callbacks even if the file thread was partway through an
operation).
(WebCore::AsyncFileStream::getSize): Changed to use the perform function.
(WebCore::AsyncFileStream::openForRead): Ditto. Also fixed reference count
thread safety issue by capturing a StringCapture rather than a String.
(WebCore::AsyncFileStream::openForWrite): Ditto.
(WebCore::AsyncFileStream::close): Changed to use callOnFileThread.
(WebCore::AsyncFileStream::read): Changed to use the perform function.
(WebCore::AsyncFileStream::write): Ditto. Also fixed reference count
thread safety issue by capturing a StringCapture rather than a URL.
(WebCore::AsyncFileStream::truncate): Ditto.

* fileapi/AsyncFileStream.h: Removed use of RefCounted since we only need
single ownership. Removed the stop function, since we can now stop when
the stream is destroyed since we have single ownership. Made a new Internals
object to handle destruction while operations are still going on the file thread.

* fileapi/FileThread.cpp: Removed.
* fileapi/FileThread.h: Removed.

* loader/ResourceLoader.cpp: Removed unneeded include.

* platform/FileStream.cpp:
(WebCore::FileStream::~FileStream): Merged the stop function in here.

* platform/FileStream.h: Removed use of RefCounted since we only need
single ownership. Removed the empty start function. Removed the stop function,
since we can now stop when the stream is destroyed since we have single ownership.

* platform/FileStreamClient.h: Removed unneeded didStart and didStop.

* platform/network/BlobResourceHandle.cpp:
(WebCore::BlobResourceHandle::BlobResourceHandle): Use make_unique to make the
stream objects instead of custom create functions.
(WebCore::BlobResourceHandle::~BlobResourceHandle): Removed now-unneeded code
to call stop functions. Destroying the objects now takes care of the this, and
that's done by the unique_ptrs.
(WebCore::BlobResourceHandle::cancel): Removed the rest of the code to stop the
m_asyncStream, keeping only the code that sets it to null. That now stops the
stream by destroying it.

* platform/network/BlobResourceHandle.h: Use std::unique_ptr rather than
RefPtr for the file stream objects.

* storage/StorageThread.h: Tweaked formatting of std::function<void()> to
match the format used elsewhere in WebKit.

Source/WebKit:

* WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in:
Removed exports of obsolete threading functions.

Source/WTF:

* wtf/MessageQueue.h: Made queue work on any type and not require wrapping
everything in a unique_ptr.

* wtf/Threading.cpp:
(WTF::threadEntryPoint): Changed to use a std::function instead of a function pointer.
(WTF::createThread): Add a version that takes a std::function. Reimplemented the
old version using lambdas. Removed the obsolete versions that were there just to support
binary compatibility with very old versions of Safari.

* wtf/Threading.h: Removed an incorrect license header that covers code that was long ago
moved to a different file. Changed createThread to take a std::function instead of a function
pointer and data pointer. Moved internal functions after public functions.

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

6 years agoDon't try to schedule a GraphicsLayer flush when propagating changes to replicas...
simon.fraser@apple.com [Sat, 8 Nov 2014 23:50:43 +0000 (23:50 +0000)]
Don't try to schedule a GraphicsLayer flush when propagating changes to replicas inside a flush
https://bugs.webkit.org/show_bug.cgi?id=138532

Reviewed by Dan Bernstein.

When changing masks on replica layers with certain layer configurations,
it was possible to hit an assertion that a flush was being scheduled when already
flushing, via propagateLayerChangeToReplicas(). Fix by passing the scheduleFlush
flag along.

Not testable with current GraphicsLayer configurations.

* platform/graphics/ca/GraphicsLayerCA.cpp:
* platform/graphics/ca/GraphicsLayerCA.h:

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

6 years agoWKActionMenuController methods should be more careful to use the best
bdakin@apple.com [Sat, 8 Nov 2014 20:27:13 +0000 (20:27 +0000)]
WKActionMenuController methods should be more careful to use the best
WebHitTestResult
https://bugs.webkit.org/show_bug.cgi?id=138536
-and corresponding-
rdar://problem/18919195

Reviewed by Tim Horton.

This patch re-names _hitTestResultForStage to _webHitTestResult. The method no
longer takes a stage since that value is really not necessary to determine the
correct WebHitTestResult. This patch also makes all spots in this file that access
a WebHitTestResult go through _webHitTestResult to ensure that they get the most
up-to-date option.
* UIProcess/mac/WKActionMenuController.mm:
(-[WKActionMenuController willOpenMenu:withEvent:]):
(-[WKActionMenuController _openURLFromActionMenu:]):
(-[WKActionMenuController _addToReadingListFromActionMenu:]):
(-[WKActionMenuController _previewURLFromActionMenu:]):
(-[WKActionMenuController _defaultMenuItemsForVideo]):
(-[WKActionMenuController _copyVideoURL:]):
(-[WKActionMenuController _saveVideoToDownloads:]):
(-[WKActionMenuController _saveImageToDownloads:]):
(-[WKActionMenuController _defaultMenuItems]):
(-[WKActionMenuController _updateActionMenuItemsForStage:]):
(imageForResource:name::switch): Deleted.
(-[WKActionMenuController _defaultMenuItems:]): Deleted.

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

6 years agoImplement action menu support for videos
bdakin@apple.com [Sat, 8 Nov 2014 19:07:50 +0000 (19:07 +0000)]
Implement action menu support for videos
https://bugs.webkit.org/show_bug.cgi?id=138534
-and corresponding-
rdar://problem/18742164

Reviewed by Tim Horton.

Source/WebCore:

Export needed symbols and added not-yet-implemented
HitTestResult::isMediaThatCanBeDownloaded() so that action menus will work as
expected once it is implemented.
* WebCore.exp.in:
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::isMediaThatCanBeDownloaded):
* rendering/HitTestResult.h:

Source/WebKit2:

New menu type and items types.
* Shared/API/c/WKActionMenuItemTypes.h:
* Shared/API/c/WKActionMenuTypes.h:

Plumb isMediaThatCanBeDownloaded() up to WebHitTestResult.
* Shared/WebHitTestResult.cpp:
(WebKit::WebHitTestResult::Data::Data):
(WebKit::WebHitTestResult::Data::encode):
(WebKit::WebHitTestResult::Data::decode):
* Shared/WebHitTestResult.h:
(WebKit::WebHitTestResult::isMediaThatCanBeDownloaded):

Re-name _canAddImageToPhotos to _canAddMediaToPhotos, which is more accurate. We
might use this method for videos some day, so now it has an accurate name.
* UIProcess/mac/WKActionMenuController.mm:

Default items and their actions.
(-[WKActionMenuController _defaultMenuItemsForVideo]):
(-[WKActionMenuController _copyVideoURL:]):
(-[WKActionMenuController _saveVideoToDownloads:]):
(-[WKActionMenuController _defaultMenuItemsForImage]):
(-[WKActionMenuController _canAddMediaToPhotos]):
(-[WKActionMenuController _addImageToPhotos:]):
(-[WKActionMenuController _createActionMenuItemForTag:]):
(-[WKActionMenuController _defaultMenuItems:]):
(-[WKActionMenuController _canAddImageToPhotos]): Deleted.

We hit test including shadow content to get the desired result for editable text
regions. But for media, we want to re-set to the shadow root.
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::performActionMenuHitTestAtLocation):

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

6 years agoSpeed up HTMLInputElement::isEmptyValue()
cdumez@apple.com [Sat, 8 Nov 2014 18:07:28 +0000 (18:07 +0000)]
Speed up HTMLInputElement::isEmptyValue()
https://bugs.webkit.org/show_bug.cgi?id=138515

Reviewed by Geoffrey Garen.

HTMLInputElement::isEmptyValue() was calling
HTMLTextFormControlElement::innerTextValue() which causes a full
subtree traversal to construct a string representation of that subtree
using a StringBuilder. In the case of HTMLInputElement::isEmptyValue(),
we don't have to do all this: We don't need to construct a String
and we can return false as soon as we find a non-empty descendant.

No new tests, no behavior change.

* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::isEmptyValue):
* html/HTMLInputElement.h:

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

6 years ago[iOS] video is sometimes allowed to play from the background
eric.carlson@apple.com [Sat, 8 Nov 2014 17:17:32 +0000 (17:17 +0000)]
[iOS] video is sometimes allowed to play from the background
https://bugs.webkit.org/show_bug.cgi?id=138522

Reviewed by Jer Noble.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::displayType): New.
* html/HTMLMediaElement.h:

* platform/audio/MediaSession.cpp:
(WebCore::MediaSession::isHidden): New, client passthrough.
(WebCore::MediaSession::displayType): Ditto.
* platform/audio/MediaSession.h:
(WebCore::MediaSessionClient::displayType):

* platform/audio/MediaSessionManager.cpp:
(WebCore::MediaSessionManager::sessionCanLoadMedia): New, default implementation returns
    true if client is visible or playing.
* platform/audio/MediaSessionManager.h:

* platform/audio/ios/MediaSessionManagerIOS.h:
* platform/audio/ios/MediaSessionManagerIOS.mm:
(WebCore::MediaSessionManageriOS::sessionCanLoadMedia): iOS override, also allows buffering
    when displaying optimized fullscreen.

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

6 years ago[GTK] Run layout tests using the network process
carlosgc@webkit.org [Sat, 8 Nov 2014 10:53:26 +0000 (10:53 +0000)]
[GTK] Run layout tests using the network process
https://bugs.webkit.org/show_bug.cgi?id=138428

Reviewed by Martin Robinson.

Shared secondary process is the default in the GTK+ port, but we
should run the tests using the network process to ensure
everything works with the network process. In the future, the
shared secondary process model might be a special case of multiple
processes with 1 as maximum number of processes, but always using
the network process.

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::initialize):

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

6 years ago[GTK] Allow to create a view with a related page in WTR
carlosgc@webkit.org [Sat, 8 Nov 2014 10:50:04 +0000 (10:50 +0000)]
[GTK] Allow to create a view with a related page in WTR
https://bugs.webkit.org/show_bug.cgi?id=138501

Reviewed by Martin Robinson.

Source/WebKit2:

This is needed when running tests in multi web process mode.

* UIProcess/API/C/gtk/WKView.cpp:
(WKViewCreate):
* UIProcess/API/C/gtk/WKView.h:

Tools:

* TestWebKitAPI/gtk/PlatformWebViewGtk.cpp:
(TestWebKitAPI::PlatformWebView::PlatformWebView): Pass nullptr as
related page to WKViewCreate.
* WebKitTestRunner/gtk/PlatformWebViewGtk.cpp:
(WTR::PlatformWebView::PlatformWebView): Pass the given related
page to WKViewCreate.

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

6 years agoWTR crashes after running a test when NetworkProcess enabled
carlosgc@webkit.org [Sat, 8 Nov 2014 10:47:08 +0000 (10:47 +0000)]
WTR crashes after running a test when NetworkProcess enabled
https://bugs.webkit.org/show_bug.cgi?id=138500

Reviewed by Alexey Proskuryakov.

WebNotificationProvider destructor is calling
WKNotificationManagerSetProvider, but m_notificationManager is
null because removeNotificationManager was already called.

* WebKitTestRunner/WebNotificationProvider.cpp:
(WTR::WebNotificationProvider::~WebNotificationProvider): Check
m_notificationManager is not null before calling WKNotificationManagerSetProvider.

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

6 years agoFix the build after r175772
benjamin@webkit.org [Sat, 8 Nov 2014 04:25:45 +0000 (04:25 +0000)]
Fix the build after r175772

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

* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::buildArrayForMatchedRuleList):

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

6 years agoMake the Selector's specificity part of Selector matching
benjamin@webkit.org [Sat, 8 Nov 2014 02:05:36 +0000 (02:05 +0000)]
Make the Selector's specificity part of Selector matching
https://bugs.webkit.org/show_bug.cgi?id=138486

Reviewed by Andreas Kling.

In CSS Selectors Level 4, the specificity of selectors is computed dynamically
based on which element is being matched.

For example, a selector:
    :matches(#foo, .bar, baz)
has a specificity of
    (1, 0, 0) on <baz id=foo class=bar>
    (0, 1, 0) on <baz class=bar>
    (0, 0, 1) on <baz>

Previously, the specificity of each selector was computed statically when populating
RuleSet. With more recent CSS, this gives us the wrong specificity because we do not know
how the selectors applies to the target.

This patch moves one tiny step in the direction of dynamic specificity. The specificity
is removed from RuleSet and is moved inside Selector Matching.

There is one bit worth keeping static: matching based on rule hash. This path is important
to avoid spending time compiling trivial selectors.
In order to keep rule hash matching working, the RuleData store which specificity class
the rule has in addition to the information about matching/not-matching. When going through
the fast path in ElementCollector, we compute the right specificity based on the type
of rule-hash matching.

* css/CSSSelector.cpp:
(WebCore::CSSSelector::specificityForOneSelector):
* css/CSSSelector.h:
* css/ElementRuleCollector.cpp:
(WebCore::ElementRuleCollector::addMatchedRule):
(WebCore::ElementRuleCollector::sortAndTransferMatchedRules):
(WebCore::ElementRuleCollector::ruleMatches):
(WebCore::ElementRuleCollector::collectMatchingRulesForList):
(WebCore::compareRules):
* css/ElementRuleCollector.h:
* css/RuleSet.cpp:
(WebCore::computeMatchBasedOnRuleHash):
(WebCore::RuleData::RuleData):
(WebCore::isSelectorMatchingHTMLBasedOnRuleHash): Deleted.
* css/RuleSet.h:
(WebCore::RuleData::matchBasedOnRuleHash):
(WebCore::RuleData::hasRightmostSelectorMatchingHTMLBasedOnRuleHash): Deleted.
(WebCore::RuleData::specificity): Deleted.
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::match):
* css/SelectorChecker.h:
* css/StyleResolver.h:
(WebCore::checkRegionSelector):
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorCodeGenerator::SelectorCodeGenerator):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker):
* cssjit/SelectorCompiler.h:
(WebCore::SelectorCompiler::ruleCollectorSimpleSelectorCheckerFunction):
(WebCore::SelectorCompiler::querySelectorSimpleSelectorCheckerFunction):
(WebCore::SelectorCompiler::ruleCollectorSelectorCheckerFunctionWithCheckingContext):
(WebCore::SelectorCompiler::querySelectorSelectorCheckerFunctionWithCheckingContext):
(WebCore::SelectorCompiler::simpleSelectorCheckerFunction): Deleted.
(WebCore::SelectorCompiler::selectorCheckerFunctionWithCheckingContext): Deleted.
* dom/SelectorQuery.cpp:
(WebCore::SelectorDataList::selectorMatches):
(WebCore::SelectorDataList::selectorClosest):
(WebCore::SelectorDataList::executeCompiledSimpleSelectorChecker):
(WebCore::SelectorDataList::executeCompiledSelectorCheckerWithCheckingContext):
(WebCore::SelectorDataList::executeCompiledSingleMultiSelectorData):
(WebCore::SelectorDataList::execute):
* dom/SelectorQuery.h:

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

6 years agoCSP is enforced for eval in report-only mode on first page load
ap@apple.com [Sat, 8 Nov 2014 00:40:54 +0000 (00:40 +0000)]
CSP is enforced for eval in report-only mode on first page load
https://bugs.webkit.org/show_bug.cgi?id=138492
rdar://problem/15782525

Reviewed by Daniel Bates.

This is covered by existing tests when running as one test per process invocation.

* page/ContentSecurityPolicy.cpp:
(WebCore::CSPDirectiveList::allowEval): Allow when in report only mode. The allowEval
function itself needs to return false, because it's used in checkEvalAndReportViolation().
(WebCore::CSPDirectiveList::allowJavaScriptURLs): Apply the same fix, although it's
not changing the behavior - this function is never called with ContentSecurityPolicy::SuppressReport.
(WebCore::CSPDirectiveList::allowInlineEventHandlers): Ditto.
(WebCore::CSPDirectiveList::allowInlineScript): Ditto.
(WebCore::CSPDirectiveList::allowInlineStyle): Ditto.
(WebCore::CSPDirectiveList::allowPluginType): Ditto.
(WebCore::CSPDirectiveList::allowScriptFromSource): Ditto.
(WebCore::CSPDirectiveList::allowObjectFromSource): Ditto.
(WebCore::CSPDirectiveList::allowChildFrameFromSource): Ditto.
(WebCore::CSPDirectiveList::allowImageFromSource): Ditto.
(WebCore::CSPDirectiveList::allowStyleFromSource): Ditto.
(WebCore::CSPDirectiveList::allowFontFromSource): Ditto.
(WebCore::CSPDirectiveList::allowMediaFromSource): Ditto.
(WebCore::CSPDirectiveList::allowConnectToSource): Ditto.
(WebCore::CSPDirectiveList::allowFormAction): Ditto.
(WebCore::CSPDirectiveList::allowBaseURI): Ditto.
(WebCore::ContentSecurityPolicy::didReceiveHeader): Remove isReportOnly() check,
which is now inside allowEval().

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

6 years ago"Lookup" action menu should read "Look up"
commit-queue@webkit.org [Sat, 8 Nov 2014 00:06:48 +0000 (00:06 +0000)]
"Lookup" action menu should read "Look up"
https://bugs.webkit.org/show_bug.cgi?id=138509

Patch by Conrad Shultz <conrad_shultz@apple.com> on 2014-11-07
Reviewed by Tim Horton.

* UIProcess/mac/WKActionMenuController.mm:
(-[WKActionMenuController _createActionMenuItemForTag:]):

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

6 years agoFix typos in r175768.
rniwa@webkit.org [Fri, 7 Nov 2014 23:51:38 +0000 (23:51 +0000)]
Fix typos in r175768.

* public/v2/app.js:
(App.AnalysisTaskViewModel.roots):

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

6 years agoIntroduce the concept of analysis task to perf dashboard
rniwa@webkit.org [Fri, 7 Nov 2014 23:47:09 +0000 (23:47 +0000)]
Introduce the concept of analysis task to perf dashboard
https://bugs.webkit.org/show_bug.cgi?id=138517

Reviewed by Andreas Kling.

Introduced the concept of an analysis task, which is created for a range of measurements for a given metric on
a single platform and used to bisect regressions in the range.

Added a new page to see the list of active analysis tasks and a page to view the contents of an analysis task.

* init-database.sql: Added a bunch of tables to store information about analysis tasks.
    analysis_tasks - Represents each analysis task. Associated with a platform and a metric and possibly with two
    test runs. Analysis tasks not associated with test runs are used for try new patches.
    analysis_test_groups - A test group in an analysis task represents a bunch of related A/B testing results.
    root_sets - A root set represents a set of roots (or packages) installed in each A/B testing.
    build_requests - A build request represents a single pending build for A/B testing.

* public/api/analysis-tasks.php: Added. Returns the specified analysis task or all analysis tasks in an array.
(main):
(format_task):

* public/api/test-groups.php: Added. Returns analysis task groups for the specified analysis task or returns
the specified analysis task group as well as build requests associated with them.
(main):
(fetch_test_groups_for_task):
(fetch_build_requests_for_task):
(fetch_build_requests_for_group):
(format_test_group):
(format_build_request):

* public/include/json-header.php:
(remote_user_name): Extracted from compute_token so that we can use it in create-analysis-task.php.
(compute_token):

* public/privileged-api/associate-bug.php:
(main): Fixed a typo.

* public/privileged-api/create-analysis-task.php: Added. Creates a new analysis task for a given test run range.
(main):
(ensure_row_by_id):
(ensure_config_from_runs):

* public/privileged-api/generate-csrf-token.php: Use remote_user_name.

* public/v2/analysis.js: Added. Various Ember data store models to represent analysis tasks and related objects.
(App.AnalysisTask):
(App.AnalysisTask.create):
(App.TestGroup):
(App.TestGroupAdapter):
(App.AnalysisTaskSerializer):
(App.TestGroupSerializer):
(App.BuildRequest):

* public/v2/app.css: Added style rules for the analysis page.

* public/v2/app.js:
(App.Pane._fetch): Use fetchRunsWithPlatformAndMetric, which has been refactored into App.Manifest.

(App.PaneController.actions.toggleBugsPane): Show bugs pane even when there are no bug trackers or there is not
exactly one selected point as we can still create an analysis task.
(App.PaneController.actions.associateBug): Renamed singlySelectedPoint to selectedSinglePoint to be more
grammatical and also alert'ed the error message when there is one.
(App.PaneController.actions.createAnalysisTask): Added. Creates a new analysis task and opens it in a new tab.
Since window.open only works during the click, we open the new "window" preemptively and navigates or closes it
once XHR request has completed.
(App.PaneController._detailsChanged): Changes due to singlySelectedPoint to selectedSinglePoint rename.
(App.PaneController._updateBugs): Fixed a bug that we were showing bugs in the previous point when a single point
is selected in the details pane.

(App.AnalysisRoute): Added.
(App.AnalysisTaskRoute): Added.
(App.AnalysisTaskViewModel): Added.
(App.AnalysisTaskViewModel._taskUpdated): Fetch runs for the associated platform and metric.
(App.AnalysisTaskViewModel._fetchedRuns): Setup the chart data to show.
(App.AnalysisTaskViewModel.testSets): The computed property used to update roots for all repositories/projects.
(App.AnalysisTaskViewModel._rootChangedForTestSet): Updates root selections for all repositories/projects when
the user selects an option for all roots in A or B configuration.
(App.AnalysisTaskViewModel.roots): The computed property used to show root choices for each repository/project.

* public/v2/chart-pane.css: Added style rules for details view in the analysis task page.

* public/v2/data.js:
(Measurement.prototype._formatRevisionRange): Don't prefix a revision number with "At " when there is no previous
point so that we can use it in App.AnalysisTaskViewModel.roots.
(TimeSeries.prototype.findPointByMeasurementId): Added.
(TimeSeries.prototype.seriesBetweenPoints): Added.

* public/v2/index.html: Use Metric.fullName since the same value is needed in the analysis task page. Also added
a button to create an analysis task, and made bugs pane button always enabled since we can an analysis task even
when multiple points are selected. Finally, added a new template for the analysis task page.

* public/v2/manifest.js:
(App.Metric.fullName): Added to share code between the charts page and the analysis task page.
(App.Manifest.fetchRunsWithPlatformAndMetric): Extracted from App.Pane._fetch to be reused in
App.AnalysisTaskViewModel._taskUpdated.

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

6 years agoWeb Inspector: Layer summary should be bottom sticky
joepeck@webkit.org [Fri, 7 Nov 2014 23:37:38 +0000 (23:37 +0000)]
Web Inspector: Layer summary should be bottom sticky
https://bugs.webkit.org/show_bug.cgi?id=138518

Reviewed by Timothy Hatcher.

Previously only NavigationSidebars had a content view. Now, give all
Sidebars a contentElement section for content.

Update all Details Sidebars to append content to the contentElement
instead of directly to the element. Only two Details sidebars append
to the element:

  - CSSStyleDetailsSidebarPanel for the navigation bar at the top
  - LayerTreeDetailsSidebarPanel for the summary view at the bottom

Take this opportunity to fix up some naming and styles as well.

* UserInterface/Views/SidebarPanel.js:
(WebInspector.SidebarPanel):
(WebInspector.SidebarPanel.prototype.get contentElement):
Give every SidebarPanel a content element.

* UserInterface/Views/DetailsSidebarPanel.css: Removed.
(.sidebar > .panel > .content):
* UserInterface/Views/SidebarPanel.css: Added.
(.sidebar > .panel > .content):
And give that content element a default style.

* UserInterface/Views/NavigationSidebarPanel.css:
(.sidebar > .panel.navigation > .content):
* UserInterface/Views/NavigationSidebarPanel.js:
(WebInspector.NavigationSidebarPanel):
(WebInspector.NavigationSidebarPanel.prototype.createContentTreeOutline):
(WebInspector.NavigationSidebarPanel.prototype._updateContentOverflowShadowVisibility):
(WebInspector.NavigationSidebarPanel.prototype.get contentElement): Deleted.
Navigation sidebar panels now use the parent's contentElement.
Also, carry over their default styles, overriding the base.

* UserInterface/Views/LayerTreeDetailsSidebarPanel.js: Renamed from Source/WebInspectorUI/UserInterface/Views/LayerTreeSidebarPanel.js.
(WebInspector.LayerTreeDetailsSidebarPanel.prototype._buildLayerInfoSection):
(WebInspector.LayerTreeDetailsSidebarPanel.prototype._buildDataGridSection):
(WebInspector.LayerTreeDetailsSidebarPanel.prototype._buildBottomBar):
Rename LayerTreeSidebarPanel to make it clear this is a DetailsSidebarPanel.
Add the "bottom bar" to the root element, and sections to the contentElement.

* UserInterface/Views/LayerTreeDetailsSidebarPanel.css: Renamed from Source/WebInspectorUI/UserInterface/Views/LayerTreeSidebarPanel.css.
(.sidebar > .layer-tree.panel > .content):
(body.mac-platform.legacy .sidebar > .layer-tree.panel > .content):
Style the bottom bar to pin it to the bottom of the sidebar panel.

(WebInspector.CSSStyleDetailsSidebarPanel):
(WebInspector.CSSStyleDetailsSidebarPanel.prototype.refresh):
(WebInspector.CSSStyleDetailsSidebarPanel.prototype._navigationItemSelected):
Add the navigation bar to the root element, and sections to the contentElement.

* UserInterface/Base/Main.js:
(WebInspector.contentLoaded):
* UserInterface/Main.html:
* WebInspectorUI.vcxproj/WebInspectorUI.vcxproj:
* WebInspectorUI.vcxproj/WebInspectorUI.vcxproj.filters:
Update for new names.

* UserInterface/Views/ApplicationCacheDetailsSidebarPanel.js:
(WebInspector.ApplicationCacheDetailsSidebarPanel):
* UserInterface/Views/CSSStyleDetailsSidebarPanel.js:
* UserInterface/Views/DOMDetailsSidebarPanel.js:
(WebInspector.DOMDetailsSidebarPanel):
* UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
(WebInspector.DOMNodeDetailsSidebarPanel):
* UserInterface/Views/DetailsSidebarPanel.js:
(WebInspector.DetailsSidebarPanel):
* UserInterface/Views/ProbeDetailsSidebarPanel.js:
* UserInterface/Views/ResourceDetailsSidebarPanel.js:
(WebInspector.ResourceDetailsSidebarPanel):
(WebInspector.ResourceDetailsSidebarPanel.prototype._refreshURL):
(WebInspector.ResourceDetailsSidebarPanel.prototype._refreshImageSizeSection):
(WebInspector.ResourceDetailsSidebarPanel.prototype._refreshRequestDataSection):
* UserInterface/Views/ScopeChainDetailsSidebarPanel.js:
(WebInspector.ScopeChainDetailsSidebarPanel.prototype.refresh.delayedWork):
(WebInspector.ScopeChainDetailsSidebarPanel.prototype.refresh):
All details sidebar panels now use the contentElement instead of element for content.

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

6 years agoFix an alignment issue with operationPushCatchScope on ARMv7
dbatyai.u-szeged@partner.samsung.com [Fri, 7 Nov 2014 23:36:20 +0000 (23:36 +0000)]
Fix an alignment issue with operationPushCatchScope on ARMv7
https://bugs.webkit.org/show_bug.cgi?id=138510

Reviewed by Csaba Osztrogonác.

* jit/CCallHelpers.h:
(JSC::CCallHelpers::setupArgumentsWithExecState):
* jit/JITInlines.h:
(JSC::JIT::callOperation):

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

6 years ago[Mac] Avoid repainting scrollbar track when the scrollbar track is transparent.
akling@apple.com [Fri, 7 Nov 2014 23:10:17 +0000 (23:10 +0000)]
[Mac] Avoid repainting scrollbar track when the scrollbar track is transparent.
<https://webkit.org/b/138521>
<rdar://problem/18892090>

Reviewed by Simon Fraser.

Don't bother invalidating the entire WebCore scrollbar when we've opted into
AppKit's special mode to use individual layers for scrollbar components.
NSScrollerImp will invalidate what's necessary below e.g setKnobAlpha.

* platform/mac/ScrollAnimatorMac.mm:
(-[WebScrollbarPartAnimation setCurrentProgress:]):

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

6 years agoRename HTMLInputElement::imageLoader() to ensureImageLoader()
cdumez@apple.com [Fri, 7 Nov 2014 22:14:50 +0000 (22:14 +0000)]
Rename HTMLInputElement::imageLoader() to ensureImageLoader()
https://bugs.webkit.org/show_bug.cgi?id=138508

Reviewed by Andreas Kling.

Rename HTMLInputElement::imageLoader() to ensureImageLoader() and have
it return a reference to make it clear that it constructs an
ImageLoader if missing.
Also introduce a lightweight imageLoader() getter which just returns
the imageLoader or null if missing.

No new tests, no behavior change.

* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::ensureImageLoader):
(WebCore::HTMLInputElement::didMoveToNewDocument):
(WebCore::HTMLInputElement::imageLoader): Deleted.
* html/HTMLInputElement.h:
(WebCore::HTMLInputElement::imageLoader):
(WebCore::HTMLInputElement::hasImageLoader): Deleted.
* html/ImageInputType.cpp:
(WebCore::ImageInputType::srcAttributeChanged):
(WebCore::ImageInputType::attach):
(WebCore::ImageInputType::height):
(WebCore::ImageInputType::width):

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

6 years agoWeb Inspector: Cursor and scroll view jumps around when modifying styles
timothy@apple.com [Fri, 7 Nov 2014 22:01:59 +0000 (22:01 +0000)]
Web Inspector: Cursor and scroll view jumps around when modifying styles
https://bugs.webkit.org/show_bug.cgi?id=137467

This merges commit e2962a5b0df56c8ee5a4482899d308decf3d7677 from CodeMirror.

Reviewed by Joseph Pecoraro.

* UserInterface/External/CodeMirror/codemirror.js:
(maybeScrollWindow): Signal the scrollCursorIntoView event.
(signalDOMEvent): Support string events by transforming them to event objects.

* UserInterface/Views/CodeMirrorAdditions.js:
(scrollCursorIntoView): Added. Default event listener that provides our own
implementation using WebKit's scrollIntoViewIfNeeded.

* UserInterface/Views/RulesStyleDetailsPanel.js:
(WebInspector.RulesStyleDetailsPanel.prototype.refresh): Stop doing an
extra scrollIntoViewIfNeeded call, CodeMirror does this.

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

6 years agoUpdate scope related slow path code to use scope register added to opcodes
msaboff@apple.com [Fri, 7 Nov 2014 21:58:43 +0000 (21:58 +0000)]
Update scope related slow path code to use scope register added to opcodes
https://bugs.webkit.org/show_bug.cgi?id=138254

Reviewed by Mark Lam.

Updated slow paths for op_pop_scope, op_push_name_scope and op_push_with_scope.
Added scope register index parameter to the front of the relevant argument lists of the
slow functions.  In the case of op_push_name_scope for x86 (32 bit), there aren't enough
registers to accomodate all the parameters.  Therefore, added two new JSVALUE32_64 slow
paths called operationPushCatchScope() and operationPushFunctionNameScope() to eliminate
the last "type" argument.

* assembler/MacroAssemblerCodeRef.h:
(JSC::FunctionPtr::FunctionPtr): Added a new template to take 6 arguments.

* jit/CCallHelpers.h:
(JSC::CCallHelpers::setupArgumentsWithExecState):
* jit/JIT.h:
* jit/JITInlines.h:
(JSC::JIT::callOperation):
New variants of setupArgumentsWithExecState() and callOperation() to handle the new
combinations of argument types and counts.

* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_push_with_scope):
(JSC::JIT::emit_op_pop_scope):
(JSC::JIT::emit_op_push_name_scope):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_push_with_scope):
(JSC::JIT::emit_op_pop_scope):
(JSC::JIT::emit_op_push_name_scope):
Use the new slow paths.

* jit/JITOperations.cpp:
* jit/JITOperations.h:
Updates to set the scope result using the scope register index.  Added operationPushCatchScope()
and operationPushFunctionNameScope().

* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
Updated the scope slow paths to use the scope register index in the instruction to read and
write the register instead of using CallFrame::scope() and CallFrame::setScope().

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

6 years agoNull deref performing Lookup on Apple Trailers full screen button
bdakin@apple.com [Fri, 7 Nov 2014 21:29:45 +0000 (21:29 +0000)]
Null deref performing Lookup on Apple Trailers full screen button
https://bugs.webkit.org/show_bug.cgi?id=138513
-and corresponding-
rdar://problem/18909699

Reviewed by Tim Horton.

* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::performDictionaryLookupForSelection):

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

6 years agoMove 'webkit-clip-path' CSS property to the new StyleBuilder
cdumez@apple.com [Fri, 7 Nov 2014 21:21:57 +0000 (21:21 +0000)]
Move 'webkit-clip-path' CSS property to the new StyleBuilder
https://bugs.webkit.org/show_bug.cgi?id=138452

Reviewed by Andreas Kling.

Source/WebCore:

Move 'webkit-clip-path' CSS property from DeprecatedStyleBuilder to the
new StyleBuilder so that it is now generated from CSSPropertyNames.in.

A ClipPath converter was added to support this. Custom code was avoided
by replacing if checks by assertions, relying on the CSSParser to make
sure the input is valid.

Test: fast/masking/clip-path-bad-value.html

* css/CSSPropertyNames.in:
* css/DeprecatedStyleBuilder.cpp:
(WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
(WebCore::ApplyPropertyClipPath::setValue): Deleted.
(WebCore::ApplyPropertyClipPath::applyValue): Deleted.
(WebCore::ApplyPropertyClipPath::createHandler): Deleted.
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertClipPath):

LayoutTests:

Add layout test to make sure we don't crash in the StyleBuilder when
setting unexpected values to webkit-clip-path property.

* fast/masking/clip-path-bad-value-expected.txt: Added.
* fast/masking/clip-path-bad-value.html: Added.

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

6 years agoMake it possible to associate snapshots with back/forward list items other than the...
commit-queue@webkit.org [Fri, 7 Nov 2014 20:35:23 +0000 (20:35 +0000)]
Make it possible to associate snapshots with back/forward list items other than the current item.
https://bugs.webkit.org/show_bug.cgi?id=138490

Patch by Anshu Chimala <anshu@apple.com> on 2014-11-07
Reviewed by Tim Horton.

* UIProcess/API/Cocoa/WKViewPrivate.h:
Declare -saveBackForwardSnapshotForItem:, an alternative to -saveBackForwardSnapshotForCurrentItem that accepts a
back/forward list item as an argument.
* UIProcess/API/mac/WKView.mm:
(-[WKView saveBackForwardSnapshotForItem:]):
Pass the provided back/forward list item along to WebPageProxy::recordNavigationSnapshot().

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::recordNavigationSnapshot):
Overloaded to optionally take a back/forward list item as an argument. If one isn't provided, default to the current item
as before; otherwise, associate the snapshot with whichever item was provided.
* UIProcess/WebPageProxy.h:
Declare the new recordNavigationSnapshot() overload.

* UIProcess/mac/ViewSnapshotStore.h:
Make recordSnapshot() take a back/forward list item as an argument.
* UIProcess/mac/ViewSnapshotStore.mm:
(WebKit::ViewSnapshotStore::recordSnapshot):
Store the snapshot in the provided back/forward list item instead of in the current item.

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

6 years agoWeb Inspector: Pseudo element matchedCSSRules do not include matching selector info
joepeck@webkit.org [Fri, 7 Nov 2014 20:29:49 +0000 (20:29 +0000)]
Web Inspector: Pseudo element matchedCSSRules do not include matching selector info
https://bugs.webkit.org/show_bug.cgi?id=138438

Reviewed by Benjamin Poulain.

Source/WebCore:

Test: inspector/css/psuedo-element-matches.html

Element::matches is not the correct API to use to check selectors with pseudo-elements.
Instead we should use the CSS Selector checking machinary which understands them.

* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::getSupportedCSSProperties):
(WebCore::InspectorCSSAgent::buildArrayForRuleList):
(WebCore::InspectorCSSAgent::buildArrayForRegions):
(WebCore::InspectorCSSAgent::buildObjectForNamedFlow):
Some RefPtr release improvements.

(WebCore::InspectorCSSAgent::buildArrayForMatchedRuleList):
Use a SelectorChecker to check each Selector against the element.
This matches the SelectorChecker used when we collected the rules
for this element.

Source/WebInspectorUI:

* UserInterface/Base/Test.js:
(WebInspector.loaded):
Include a global setting for shadow dom used by DOM model classes.
Give it a "test" specific name to not override non-test setting values.

LayoutTests:

* inspector/css/pseudo-element-matches-expected.txt: Added.
* inspector/css/pseudo-element-matches.html: Added.
Add a test to ensure we get correct selector matches for a pseudo element
inside of an <audio> element. The test is heavily coupled to our UserAgent
stylesheet and Shadow DOM layout, so check for possible failures if
WebCore changes things.

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

6 years agoPopovers do not dismiss when navigating back and forth using gestures
timothy_horton@apple.com [Fri, 7 Nov 2014 20:25:17 +0000 (20:25 +0000)]
Popovers do not dismiss when navigating back and forth using gestures
https://bugs.webkit.org/show_bug.cgi?id=138512
<rdar://problem/18900200>

Reviewed by Beth Dakin.

* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::navigationGestureDidBegin):
Dismiss action menu related popovers when navigation gestures begin.

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

6 years agoAction menu preview popover should dismiss on scroll
bdakin@apple.com [Fri, 7 Nov 2014 20:06:48 +0000 (20:06 +0000)]
Action menu preview popover should dismiss on scroll
https://bugs.webkit.org/show_bug.cgi?id=138511
-and corresponding-
rdar://problem/18901445

Reviewed by Tim Horton.

This patch re-names dismissActionMenuDataDetectorPopovers() to
dismissActionMenuPopovers() and also calls _clearPreviewPopover from that method
as well.
* UIProcess/API/mac/WKView.mm:
(-[WKView viewDidMoveToWindow]):
(-[WKView _dismissActionMenuPopovers]):
(-[WKView _dismissActionMenuDataDetectorPopovers]): Deleted.
* UIProcess/API/mac/WKViewInternal.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didCommitLoadForFrame):
(WebKit::WebPageProxy::pageDidScroll):
(WebKit::WebPageProxy::resetStateAfterProcessExited):
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::dismissActionMenuPopovers):
(WebKit::PageClientImpl::dismissActionMenuDataDetectorPopovers): Deleted.
* UIProcess/mac/WKActionMenuController.h:
* UIProcess/mac/WKActionMenuController.mm:
(-[WKActionMenuController dismissActionMenuPopovers]):
(-[WKActionMenuController dismissActionMenuDataDetectorPopovers]): Deleted.

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

6 years ago[CSS Shapes] the sandbag JS utility code isn't producing the correct expected result...
bjonesbe@adobe.com [Fri, 7 Nov 2014 20:02:58 +0000 (20:02 +0000)]
[CSS Shapes] the sandbag JS utility code isn't producing the correct expected result in the shape-image gradient tests
https://bugs.webkit.org/show_bug.cgi?id=135923

Reviewed by Dirk Schulze.

Import tests from upstream. They have been modified so that they use
testharness to validate success or failure instead of being reftests,
allowing for fuzziness in matching to get around small variances
between implementations.

* TestExpectations:
* css3/shapes/shape-outside/shape-image/gradients/shape-outside-radial-gradient-001-expected.html: Removed.
* css3/shapes/shape-outside/shape-image/gradients/shape-outside-radial-gradient-001-expected.txt: Added.
* css3/shapes/shape-outside/shape-image/gradients/shape-outside-radial-gradient-001.html:
* css3/shapes/shape-outside/shape-image/gradients/shape-outside-radial-gradient-002-expected.html: Removed.
* css3/shapes/shape-outside/shape-image/gradients/shape-outside-radial-gradient-002-expected.txt: Added.
* css3/shapes/shape-outside/shape-image/gradients/shape-outside-radial-gradient-002.html:
* css3/shapes/shape-outside/shape-image/gradients/shape-outside-radial-gradient-003-expected.html: Removed.
* css3/shapes/shape-outside/shape-image/gradients/shape-outside-radial-gradient-003-expected.txt: Added.
* css3/shapes/shape-outside/shape-image/gradients/shape-outside-radial-gradient-003.html:
* css3/shapes/shape-outside/shape-image/gradients/shape-outside-radial-gradient-004-expected.html: Removed.
* css3/shapes/shape-outside/shape-image/gradients/shape-outside-radial-gradient-004-expected.txt: Added.
* css3/shapes/shape-outside/shape-image/gradients/shape-outside-radial-gradient-004.html:
* css3/shapes/shape-outside/shape-image/gradients/w3c-import.log:
* css3/shapes/shape-outside/supported-shapes/support/test-utils.js:
(verifyTextPoints):

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

6 years agoSupport action menus for whitespace in editable areas
bdakin@apple.com [Fri, 7 Nov 2014 18:58:00 +0000 (18:58 +0000)]
Support action menus for whitespace in editable areas
https://bugs.webkit.org/show_bug.cgi?id=138488
-and corresponding-
rdar://problem/18877717

Reviewed by Tim Horton.

Very simple menu for whitespace in editable areas.
* Shared/API/c/WKActionMenuTypes.h:
* UIProcess/mac/WKActionMenuController.mm:
(-[WKActionMenuController _defaultMenuItemsForWhitespaceInEditableArea]):
(-[WKActionMenuController _defaultMenuItems:]):

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

6 years agoInvoking an action menu should dismiss existing selection
bdakin@apple.com [Fri, 7 Nov 2014 18:54:27 +0000 (18:54 +0000)]
Invoking an action menu should dismiss existing selection
https://bugs.webkit.org/show_bug.cgi?id=138496
-and corresponding-
rdar://problem/18892787

Reviewed by Tim Horton.

* UIProcess/mac/WKActionMenuController.mm:
(-[WKActionMenuController willOpenMenu:withEvent:]):

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

6 years agoDrop useless HTMLElement::isURLAttribute() override
cdumez@apple.com [Fri, 7 Nov 2014 18:28:42 +0000 (18:28 +0000)]
Drop useless HTMLElement::isURLAttribute() override
https://bugs.webkit.org/show_bug.cgi?id=138479

Reviewed by Mark Lam.

Drop useless HTMLElement::isURLAttribute() override as it is doing
nothing but calling the parent class' isURLAttribute().

No new tests, no behavior change.

* html/HTMLElement.cpp:
(WebCore::HTMLElement::isURLAttribute): Deleted.
* html/HTMLElement.h:

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

6 years agobmalloc uses 8X more virtual memory than necessary
ggaren@apple.com [Fri, 7 Nov 2014 18:12:40 +0000 (18:12 +0000)]
bmalloc uses 8X more virtual memory than necessary
https://bugs.webkit.org/show_bug.cgi?id=138495

Reviewed by Mark Lam.

iOS has a per-process virtual memory cap around 1GB, so there's some
value to not going totally ham with virtual memory.

We currently use about 8X the necessary amount:
    - 2X to align our VM allocation
    - 4X to reserve small / medium / (2) large chunk VM ranges per superchunk

We can cut that down:
    - Return the unaligned portion of our VM allocation (-2X)
    - Use all the chunks in a superchunk, instead of allocating one
      chunk per superchunk (-4X)

* bmalloc/Algorithm.h:
(bmalloc::roundUpToMultipleOf): Added a non-constant version of this
function so we can call it with getpagesize() at runtime.

* bmalloc/Chunk.h:
* bmalloc/LargeChunk.h:
(bmalloc::LargeChunk::create): Deleted. Instead of each chunk allocating
its own VM, VMHeap allocates the superchunk and all the chunks in it at a time.

* bmalloc/VMAllocate.h:
(bmalloc::vmValidate):
(bmalloc::vmAllocate): ASSERT that mmap succeeds to make crashes clearer
if it does not succeed. Allocate precisely, and give back the extra.

* bmalloc/VMHeap.cpp:
(bmalloc::VMHeap::allocateSuperChunk):
(bmalloc::VMHeap::allocateSmallChunk): Deleted.
(bmalloc::VMHeap::allocateMediumChunk): Deleted.
(bmalloc::VMHeap::allocateLargeChunk): Deleted. Use all the chunks
in a superchunk, instead of just one.

* bmalloc/VMHeap.h:
(bmalloc::VMHeap::allocateSmallPage):
(bmalloc::VMHeap::allocateMediumPage):
(bmalloc::VMHeap::allocateLargeRange):
* bmalloc/XLargeChunk.h:
(bmalloc::XLargeChunk::create): Updated to match changes above.

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

6 years ago[iOS] Update optimized fullscreen media controls
eric.carlson@apple.com [Fri, 7 Nov 2014 18:10:54 +0000 (18:10 +0000)]
[iOS] Update optimized fullscreen media controls
https://bugs.webkit.org/show_bug.cgi?id=138493

Reviewed by Brent Fulgham.

Source/WebCore:

* Modules/mediacontrols/MediaControlsHost.cpp:
(WebCore::MediaControlsHost::fullscreenMode): New.
(WebCore::MediaControlsHost::mediaUIImageData): New.
* Modules/mediacontrols/MediaControlsHost.h:
* Modules/mediacontrols/MediaControlsHost.idl:

* Modules/mediacontrols/mediaControlsiOS.css:
Renamed -webkit-media-controls-wireless-playback-status to -webkit-media-controls-inline-playback-placeholder
    because it is now used for other inline playback status display. Add z-index:0 so the placeholder
    renders above captions. Remove the background-image, it is now set from script.
(audio::-webkit-media-controls-inline-playback-placeholder):
(audio::-webkit-media-controls-inline-playback-placeholder.hidden):
(video::-webkit-media-controls-optimized-fullscreen-button):
(audio::-webkit-media-controls-wireless-playback-status): Deleted.
(audio::-webkit-media-controls-wireless-playback-status.hidden): Deleted.
(video::-webkit-media-controls-optimized-fullscreen-button:active): Deleted.

* Modules/mediacontrols/mediaControlsiOS.js:
(ControllerIOS): Set doingSetup to true around setup so we don't draw the inline controls
    briefly when an element is created as a result of a user gesture.
(ControllerIOS.prototype.shouldHaveStartPlaybackButton): Don't allow inline controls during
    initial setup to prevent inline controls from begin drawn briefly when a media element
    is created and inserted by a script called from a user gesture.
(ControllerIOS.prototype.updateWirelessPlaybackStatus): wirelessPlaybackStatus -> inlinePlaybackPlaceholder.
(ControllerIOS.prototype.createControls): Ditto. Add style rules for optimized fullscreen button.
(ControllerIOS.prototype.configureInlineControls): Add the inlinePlaybackPlaceholder as a peer of
    the inline controls compositing child instead of as a child so it renders correctly.
(ControllerIOS.prototype.addControls):
(ControllerIOS.prototype.updateControls): wirelessPlaybackStatus -> inlinePlaybackPlaceholder.
(ControllerIOS.prototype.handleWrapperTouchStart):
(ControllerIOS.prototype.get pageScaleFactor): Cleanup.
(ControllerIOS.prototype.set pageScaleFactor): Ditto.
(ControllerIOS.prototype.handleFullscreenChange): Show the placeholder.

* WebCore.exp.in: Export _wkGetMediaUIImageData.

* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::fullscreenMode): Expose fullscreen mode.

* platform/ios/WebCoreSystemInterfaceIOS.h:
* platform/ios/WebCoreSystemInterfaceIOS.mm:

Source/WebKit/mac:

* WebCoreSupport/WebSystemInterface.mm:
(InitWebCoreSystemInterface): Initialize GetMediaUIImageData.

Source/WebKit2:

* WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
(InitWebCoreSystemInterface): Initialize GetMediaUIImageData.

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

6 years agoAdd cache coders
antti@apple.com [Fri, 7 Nov 2014 11:29:55 +0000 (11:29 +0000)]
Add cache coders
https://bugs.webkit.org/show_bug.cgi?id=138413

Reviewed by Anders Carlsson.

Add encoding and decoding support for cache types.

This is largely a copy of the IPC coder classes with some unnecessary features removed.
The coders compute a type-sensitive checksum that can be used to verify the data integrity.

The code is behind ENABLE(NETWORK_CACHE) and not yet used.

* NetworkProcess/cache: Added.
* NetworkProcess/cache/NetworkCacheCoder.h: Added.
* NetworkProcess/cache/NetworkCacheCoders.cpp: Added.
* NetworkProcess/cache/NetworkCacheCoders.h: Added.
* NetworkProcess/cache/NetworkCacheDecoder.cpp: Added.
* NetworkProcess/cache/NetworkCacheDecoder.h: Added.
* NetworkProcess/cache/NetworkCacheEncoder.cpp: Added.
* NetworkProcess/cache/NetworkCacheEncoder.h: Added.
* WebKit2.xcodeproj/project.pbxproj:

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

6 years ago[EFL] Require at least EFL 1.9 if ENABLE(ACCESSIBILITY) after r175098
evab.u-szeged@partner.samsung.com [Fri, 7 Nov 2014 10:07:13 +0000 (10:07 +0000)]
[EFL] Require at least EFL 1.9 if ENABLE(ACCESSIBILITY) after r175098
https://bugs.webkit.org/show_bug.cgi?id=138465

Reviewed by Gyuyoung Kim.

* Source/cmake/OptionsEfl.cmake:

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

6 years agoApply std::unique_ptr to slowPathCall()
gyuyoung.kim@samsung.com [Fri, 7 Nov 2014 09:21:52 +0000 (09:21 +0000)]
Apply std::unique_ptr to slowPathCall()
https://bugs.webkit.org/show_bug.cgi?id=138489

Reviewed by Mark Lam.

As a step to use std::unique_ptr<>, this patch makes slowPathCall() use std::unique_ptr<>,
std::make_unique<>, and WTF::move().

* dfg/DFGSlowPathGenerator.h:
(JSC::DFG::slowPathCall):
(JSC::DFG::slowPathMove):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::emitAllocateJSArray):
(JSC::DFG::SpeculativeJIT::addSlowPathGenerator):
(JSC::DFG::SpeculativeJIT::arrayify):
(JSC::DFG::SpeculativeJIT::compileIn):
(JSC::DFG::SpeculativeJIT::compileGetByValOnString):
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::cachedGetById):
(JSC::DFG::SpeculativeJIT::cachedPutById):
(JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompare):
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::cachedGetById):
(JSC::DFG::SpeculativeJIT::cachedPutById):
(JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompare):
(JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeStrictEq):
(JSC::DFG::SpeculativeJIT::compile):

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

6 years agoGardening: get-by-pname.js is failing when run with JSC_useLLINT=false and other...
mark.lam@apple.com [Fri, 7 Nov 2014 08:24:41 +0000 (08:24 +0000)]
Gardening: get-by-pname.js is failing when run with JSC_useLLINT=false and other special JIT configurations.
<https://webkit.org/b/138497>

Unreviewed.

* js/script-tests/get-by-pname.js:
- temporarily skipping this from the JSC tests to green the bots until the issue is fixed.

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

6 years agoUnreviewed. Try to fix GTK build after r175719.
carlosgc@webkit.org [Fri, 7 Nov 2014 07:22:49 +0000 (07:22 +0000)]
Unreviewed. Try to fix GTK build after r175719.

Rename the Timer fired function as requestAnimationTimerFired() to
avoid ambiguity.

* platform/ScrollAnimatorNone.cpp:
(WebCore::ScrollAnimatorNone::ScrollAnimatorNone):
(WebCore::ScrollAnimatorNone::requestAnimationTimerFired):
(WebCore::ScrollAnimatorNone::animationTimerFired): Deleted.
* platform/ScrollAnimatorNone.h:

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

6 years agoRemove useless if check in HTMLInputElement::setValue()
cdumez@apple.com [Fri, 7 Nov 2014 05:53:48 +0000 (05:53 +0000)]
Remove useless if check in HTMLInputElement::setValue()
https://bugs.webkit.org/show_bug.cgi?id=138485

Reviewed by Daniel Bates.

Remove useless if check in HTMLInputElement::setValue(). It was
inadvertently left in as part of r94836.

* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::setValue):

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

6 years agoPut names on a couple of video-related CALayers
simon.fraser@apple.com [Fri, 7 Nov 2014 04:52:34 +0000 (04:52 +0000)]
Put names on a couple of video-related CALayers
https://bugs.webkit.org/show_bug.cgi?id=138491

Reviewed by Eric Carlson.

In debug, set layer names on a couple of video-related layers to make
debugging easier.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::ensureLayer):

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

6 years agoREGRESSION (r175549): http/tests/multipart/stop-crash.html failing (assertion failure...
darin@apple.com [Fri, 7 Nov 2014 03:16:42 +0000 (03:16 +0000)]
REGRESSION (r175549): http/tests/multipart/stop-crash.html failing (assertion failure in CachedResource::setEncodedSize)
https://bugs.webkit.org/show_bug.cgi?id=138358

Reviewed by Alexey Proskuryakov.

Source/WebCore:

* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::setEncodedSize): Removed the incorrect assertion here.
The code asserts that resources only get bigger, never smaller. This is incorrect
for a multipart/mixed-replace image, where a later image that is smaller can replace
an earlier one. I don't fully understand why this assertion was not firing before,
but the relevant websites are working fine and the test otherwise passes.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::subresourceLoaderFinishedLoadingOnePart): Fix another
incorrect assertion that can fire for any parts after the first one. I ran into
this while testing various websites that use multipart/mixed-replace.

LayoutTests:

* TestExpectations: Turn the test back on.

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

6 years agoRemove duplicate code from PatchAnalysisTask._test_patch and fix bug
commit-queue@webkit.org [Fri, 7 Nov 2014 02:27:49 +0000 (02:27 +0000)]
Remove duplicate code from PatchAnalysisTask._test_patch and fix bug
regarding incorrect call to PatchAnalysisTask.report_failure
https://bugs.webkit.org/show_bug.cgi?id=138229

Patch by Jake Nielsen <jacob_nielsen@apple.com> on 2014-11-06
Reviewed by Daniel Bates.

* Scripts/webkitpy/common/net/layouttestresults.py:
Makes sure test_results returns a list.
(LayoutTestResults.test_results):
* Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py:
Makes unit tests also check to make sure
task.results_from_patch_test_run() and
task.results_from_test_run_without_patch return instances of
LayoutTestResults.
(CommitQueueTaskTest._run_and_expect_patch_analysis_result):
* Scripts/webkitpy/tool/bot/patchanalysistask.py:
Condenses duplicate code into _should_defer_patch_or_throw, and
removes the now-unused _clean_tree_results member.
(PatchAnalysisTask.__init__):
(PatchAnalysisTask._continue_testing_patch_that_exceeded_failure_limit_on_first_or_second_try):
(PatchAnalysisTask._should_defer_patch_or_throw):
(PatchAnalysisTask._test_patch):
(PatchAnalysisTask.results_from_patch_test_run):
(PatchAnalysisTask.results_from_test_run_without_patch): Deleted.
* Scripts/webkitpy/tool/commands/earlywarningsystem.py:
Removes needless call to results_from_test_run_without_patch
(AbstractEarlyWarningSystem._failing_tests_message):
* Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py:
Changes order of test failure messages to be in the order that they
appear.
(AbstractEarlyWarningSystemTest.test_failing_tests_message):
* Scripts/webkitpy/tool/commands/queues.py:
Removes needless call to results_from_test_run_without_patch.
(CommitQueue._failing_tests_message):
* Scripts/webkitpy/tool/commands/queues_unittest.py:
(MockCommitQueueTask.results_from_test_run_without_patch): Deleted.

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

6 years agoWrap the bulk of -[WebView dealloc] with an autorelease pool.
commit-queue@webkit.org [Fri, 7 Nov 2014 02:11:16 +0000 (02:11 +0000)]
Wrap the bulk of -[WebView dealloc] with an autorelease pool.
https://bugs.webkit.org/show_bug.cgi?id=138443

Patch by Daniel Jalkut <jalkut@red-sweater.com> on 2014-11-06
Reviewed by Anders Carlsson.

Wrapping the dealloc method in its own autorelease pool avoids the problem of
complex tear-downs leading to the WebView itself being added to an autorelease
pool that is not drained until after the instance has been dealloc'd.

* WebView/WebView.mm:
(-[WebView dealloc]):

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

6 years agoClients should be able to customize the view used for page previews
commit-queue@webkit.org [Fri, 7 Nov 2014 02:02:08 +0000 (02:02 +0000)]
Clients should be able to customize the view used for page previews
https://bugs.webkit.org/show_bug.cgi?id=138447

Patch by Conrad Shultz <conrad_shultz@apple.com> on 2014-11-06
Reviewed by Tim Horton.

Add SPI to WKView that clients can use to customize the view used in the page preview popover.

* UIProcess/API/Cocoa/WKViewPrivate.h:
Declare -_viewForPreviewingURL:initialFrameSize:.

* UIProcess/API/mac/WKView.mm:
(-[WKView _viewForPreviewingURL:initialFrameSize:]):
Return nil in the default implementation.

* UIProcess/mac/WKActionMenuController.mm:
(-[WKPagePreviewViewController loadView]):
Only spin up a WKWebView if the delegate (and, therefore, the presenting WKView) doesn't supply a custom view.
(-[WKActionMenuController pagePreviewViewController:viewForPreviewingURL:initialFrameSize:]):
WKPagePreviewViewControllerDelegate method; wrap the WKView SPI.

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