WebKit-https.git
5 years agoRename test LayoutTests/fast/events/drag-link.html to drag-and-drop-link-into-focused...
dbates@webkit.org [Wed, 15 Apr 2015 01:59:39 +0000 (01:59 +0000)]
Rename test LayoutTests/fast/events/drag-link.html to drag-and-drop-link-into-focused-contenteditable.html
https://bugs.webkit.org/show_bug.cgi?id=143683

Reviewed by Alexey Proskuryakov.

The name of the test LayoutTests/fast/events/drag-link.html is too generic given its purpose, which is
to test that we do not cause an assertion failure when dragging and dropping an HTML hyperlink into
a focused content editable element. We should come up with a more descriptive name for this test that
better describes what it tests.

* fast/events/drag-and-drop-link-into-focused-contenteditable-expected.txt: Renamed from LayoutTests/fast/events/drag-link-expected.txt.
* fast/events/drag-and-drop-link-into-focused-contenteditable.html: Renamed from LayoutTests/fast/events/drag-link.html.
* platform/efl/TestExpectations: Update file because of the rename.
* platform/gtk/TestExpectations: Ditto.
* platform/ios-simulator/TestExpectations: Ditto.
* platform/mac-wk2/TestExpectations: Ditto.

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

5 years agoRegression(r180020): Web Inspector crashes on pages that have a stylesheet with an...
cdumez@apple.com [Wed, 15 Apr 2015 01:39:05 +0000 (01:39 +0000)]
Regression(r180020): Web Inspector crashes on pages that have a stylesheet with an invalid MIME type
https://bugs.webkit.org/show_bug.cgi?id=143745
<rdar://problem/20243916>

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

Add assertion in ContentSearchUtilities::findMagicComment() to make
sure the content String is not null or we would crash in
JSC::Yarr::interpret() later.

* inspector/ContentSearchUtilities.cpp:
(Inspector::ContentSearchUtilities::findMagicComment):

Source/WebCore:

After r180020, we are stricter and no longer accept CSS resources that
are not served with a CSS MIME type. Showing Web inspector on a page
with such bad resource would crash because
InspectorPageAgent::cachedResourceContent() would return true but
the result String would be null. This null String would then later
be passed to the Yarr interpreter and crash on a String::is8Bit()
call.

cachedResourceContent() calls CachedCSSStyleSheet::sheetText(). Before
r180020, it would return the text, even if the MIME type was incorrect.
However, this is no longer the case and we now need to make sure that
cachedResourceContent() returns false if sheetText() returns a null
String.

Test: http/tests/inspector/css/bad-mime-type.html

* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::cachedResourceContent):

LayoutTests:

Add layout test that shows the Web inspector on a page that has
a stylesheet with an invalid MIME type, to make sure we don't
crash.

* http/tests/inspector/css/bad-mime-type-expected.txt: Added.
* http/tests/inspector/css/bad-mime-type.html: Added.
* http/tests/misc/css-accept-any-type.html:
* http/tests/misc/css-reject-any-type-in-strict-mode.html:
* http/tests/misc/resources/stylesheet-bad-mime-type.php: Renamed from LayoutTests/http/tests/misc/resources/stylesheet.php.

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

5 years agotextPath layout performance improvement.
commit-queue@webkit.org [Wed, 15 Apr 2015 01:34:25 +0000 (01:34 +0000)]
textPath layout performance improvement.
https://bugs.webkit.org/show_bug.cgi?id=141570.

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2015-04-14
Reviewed by Darin Adler.

PerformanceTests:

Cut down the time spent in traversing the path for text by 50%. Instead
of traversing the path twice at a certain length: one time for the position
and the second time for the angle, we can merge these two passes into one.

* SVG/TextOnPathSimple.html: Added.
* SVG/resources/TextOnPathSimple.svg: Added.

Source/WebCore:

The bottleneck of the text-on-path performance is the position and angle
calculations for every single character. If the number of characters is
'n' and the number of path elements is 'm', the total number of processing
the path elements is O(2 x n x m). What makes it really worse is, for every
curve we keep splitting the curve till the split curve is almost a straight
line. The changes we need to do are:
1. Merge the position and the angle traversals in one pass since they are
   returning info for the same length on the path. There is a degenerate
   case for the starting point when calculating the angle. The original
   code was solving this problem by passing an epsilon instead of zero but
   because traversing the path for position and angle are now merged, we
   will pass zero for the starting point as is. All we need is to move one
   step ahead without moving the position. We need the extra step forward
   to calculate the slope of the path at the starting point.
2. We need to add a new mode to traversing a path. The new mode will take
   a vector of lengths and returns a vector of arrow vectors. Every arrow
   vector represents a position and an angle on the path at a certain length.
   This requires changing the SVGTextLayoutEngine to calculate the lengths
   of the characters on the curve first and then passing all of them to the
   path traversal function. Instead of traversing the path for every length,
   we are going to get the required point and angle from the vector of arrow
   vectors.

This patch is addressing the first fix only. The second one will require
refactoring the SVGTextLayoutEngine so I am going to address it in a
different patch.

* platform/graphics/Path.cpp:
(WebCore::pathLengthApplierFunction): It is cleaner to move the function
of this method to PathTraversalState::processPathElement().

(WebCore::Path::length): Use new enum Action value and access methods.

(WebCore::Path::traversalStateAtLength): New function which returns the
traversalState at a certain length on a path.

(WebCore::Path::pointAtLength):
(WebCore::Path::normalAngleAtLength): Use traversalStateAtLength() to get
the traversalState and from it return either the position or the angle.

* platform/graphics/Path.h: Define traversalStateAtLength().

* platform/graphics/PathTraversalState.cpp:
(WebCore::distanceLine): Code clean up.

(WebCore::curveLength): Make the setting of m_previous and m_current happens
only in this function.

(WebCore::PathTraversalState::PathTraversalState): Add an optional parameter
for the desired length and move the initialization of the other members to
the class definition.

(WebCore::PathTraversalState::closeSubpath):
(WebCore::PathTraversalState::moveTo):
(WebCore::PathTraversalState::lineTo): Add the distance to the m_totalLength
instead of returning it since this is what all the callers were doing.

(WebCore::PathTraversalState::quadraticBezierTo):
(WebCore::PathTraversalState::cubicBezierTo): Add the distance to the
m_totalLength. Move the setting of m_previous and m_current to curveLength().
Remove unused members m_control1 and m_control2.

(WebCore::PathTraversalState::processSegment): Deleted.
(WebCore::PathTraversalState::finalizeAppendPathElement): Create a new
name for the function. Handle the case of the angle at the starting point
where m_desiredLength is set to zero. The new flag m_isZeroVector will be
set to notify the caller that the  next iteration will be the last one and
it is only needed for the calculating the angle of a zero vector. m_current
should not change by this last iteration.

(WebCore::PathTraversalState::appendPathElement): This code is moved from
pathLengthApplierFunction().

(WebCore::PathTraversalState::processPathElement): This function is used
by the class Path. It is a wrapper for appendPathElement(). If m_isZeroVector
is set we append the new element to a copy for the PathTraversalState just
to get the angle for the zero vector.

* platform/graphics/PathTraversalState.h: Change the enum values to not
not include the class or the enum class. Make the data members private and
expose the needed ones through access methods. Make all the internal methods
to be private.

(WebCore::PathTraversalState::processPathElement):  Another wrapper for
appendPathElement() which is used by SVGPathTraversalStateBuilder.

(WebCore::PathTraversalState::action):
(WebCore::PathTraversalState::setAction):
(WebCore::PathTraversalState::desiredLength):
(WebCore::PathTraversalState::setDesiredLength):
(WebCore::PathTraversalState::success):
(WebCore::PathTraversalState::totalLength):
(WebCore::PathTraversalState::current):
(WebCore::PathTraversalState::normalAngle): New access methods which are now
needed after making the data members private.

* rendering/svg/SVGRootInlineBox.cpp:
(WebCore::SVGRootInlineBox::layoutCharactersInTextBoxes): Make the casting
of the renderer on the caller side.

* rendering/svg/SVGTextChunk.cpp:
(WebCore::SVGTextChunk::SVGTextChunk): The constructor should append the
elements of m_boxes instead of making this from outside the class.

(WebCore::SVGTextChunk::totalCharacters):
(WebCore::SVGTextChunk::totalLength):
(WebCore::SVGTextChunk::calculateLength): Deleted.
Replace calculateLength() by totalCharacters() and totalLength() to make
the interface cleaner.

(WebCore::SVGTextChunk::totalAnchorShift):
(WebCore::SVGTextChunk::calculateTextAnchorShift): Deleted.
Rename the function name.

(WebCore::SVGTextChunk::layout):
(WebCore::SVGTextChunk::processTextLengthSpacingCorrection):
(WebCore::SVGTextChunk::buildBoxTransformations):
(WebCore::SVGTextChunk::boxSpacingAndGlyphsTransform):
(WebCore::SVGTextChunk::processTextAnchorCorrection):
Move the chunk layout code from SVGTextChunkBuilder::layoutTextChunks()
to the SVGTextChunk::layout(). Move all the helper functions as well.

* rendering/svg/SVGTextChunk.h:
(WebCore::SVGTextChunk::hasTextAnchor):
(WebCore::SVGTextChunk::boxes): Deleted.
Add the new methods and change most of the public methods to be private.

* rendering/svg/SVGTextChunkBuilder.cpp:
(WebCore::SVGTextChunkBuilder::totalCharacters):
(WebCore::SVGTextChunkBuilder::totalLength):
(WebCore::SVGTextChunkBuilder::totalAnchorShift): This code is moved from
SVGTextLayoutEngine. It scans the boxes stored in the SVGTextChunkBuilder
and sums up the total values.

(WebCore::SVGTextChunkBuilder::transformationForTextBox):
(WebCore::SVGTextChunkBuilder::buildTextChunks):
(WebCore::SVGTextChunkBuilder::layoutTextChunks): Code clean up.

(WebCore::SVGTextChunkBuilder::addTextChunk): Deleted.
(WebCore::SVGTextChunkBuilder::processTextChunk): Deleted.
(WebCore::SVGTextChunkBuilder::processTextLengthSpacingCorrection): Deleted.
(WebCore::SVGTextChunkBuilder::processTextAnchorCorrection): Deleted.
(WebCore::SVGTextChunkBuilder::buildSpacingAndGlyphsTransform): Deleted.
This code now lives in SVGTextChunk.

* rendering/svg/SVGTextChunkBuilder.h: Add new methods for code which was
moved from SVGTextLayoutEngine and remove methods for code which was removed
to SVGTextChunk.

* rendering/svg/SVGTextLayoutEngine.cpp:
(WebCore::SVGTextLayoutEngine::beginTextPathLayout): Use the sum up methods
from SVGTextChunkBuilder instead of looping through the chunks. Also get a
clean order for defining variables and doing the calculations.

(WebCore::SVGTextLayoutEngine::finalizeTransformMatrices): Code clean up.

(WebCore::SVGTextLayoutEngine::layoutTextOnLineOrPath): Do a single path
traversal to get the position and the angle for a length on a path.

* svg/SVGAnimateMotionElement.cpp:
(WebCore::SVGAnimateMotionElement::buildTransformForProgress): Do a single
path traversal to get the position and the angle at a length on a path.

* svg/SVGPathTraversalStateBuilder.cpp:
(WebCore::SVGPathTraversalStateBuilder::SVGPathTraversalStateBuilder):
(WebCore::SVGPathTraversalStateBuilder::moveTo):
(WebCore::SVGPathTraversalStateBuilder::lineTo):
(WebCore::SVGPathTraversalStateBuilder::curveToCubic):
(WebCore::SVGPathTraversalStateBuilder::closePath):
(WebCore::SVGPathTraversalStateBuilder::setDesiredLength):
(WebCore::SVGPathTraversalStateBuilder::continueConsuming):
(WebCore::SVGPathTraversalStateBuilder::totalLength):
(WebCore::SVGPathTraversalStateBuilder::currentPoint):
(WebCore::SVGPathTraversalStateBuilder::incrementPathSegmentCount): Deleted.
(WebCore::SVGPathTraversalStateBuilder::pathSegmentIndex): Deleted.
* svg/SVGPathTraversalStateBuilder.h:
(WebCore::SVGPathTraversalStateBuilder::pathSegmentIndex):
Code clean up.

* svg/SVGPathUtilities.cpp:
(WebCore::getSVGPathSegAtLengthFromSVGPathByteStream):
(WebCore::getTotalLengthOfSVGPathByteStream):
(WebCore::getPointAtLengthOfSVGPathByteStream): Use new TraversalState::Action
enum values.

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

5 years agoDFG register fillSpeculate*() functions should validate incoming spill format is...
msaboff@apple.com [Wed, 15 Apr 2015 00:49:03 +0000 (00:49 +0000)]
DFG register fillSpeculate*() functions should validate incoming spill format is compatible with requested fill format
https://bugs.webkit.org/show_bug.cgi?id=143727

Reviewed by Geoffrey Garen.

Used the result of AbstractInterpreter<>::filter() to check that the current spill format is compatible
with the requested fill format.  If filter() reports a contradiction, then we force an OSR exit.
Removed individual checks made redundant by the new check.

* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::fillSpeculateInt32Internal):
(JSC::DFG::SpeculativeJIT::fillSpeculateCell):
(JSC::DFG::SpeculativeJIT::fillSpeculateBoolean):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::fillSpeculateInt32Internal):
(JSC::DFG::SpeculativeJIT::fillSpeculateInt52):
(JSC::DFG::SpeculativeJIT::fillSpeculateCell):
(JSC::DFG::SpeculativeJIT::fillSpeculateBoolean):

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

5 years agoReplace JavaScriptCoreOutputConsoleMessagesToSystemConsole default with an SPI
joepeck@webkit.org [Wed, 15 Apr 2015 00:47:25 +0000 (00:47 +0000)]
Replace JavaScriptCoreOutputConsoleMessagesToSystemConsole default with an SPI
https://bugs.webkit.org/show_bug.cgi?id=143691

Reviewed by Geoffrey Garen.

* API/JSRemoteInspector.h:
* API/JSRemoteInspector.cpp:
(JSRemoteInspectorSetLogToSystemConsole):
Add SPI to enable/disable logging to the system console.
This only affects JSContext `console` logs and warnings.

* inspector/JSGlobalObjectConsoleClient.h:
* inspector/JSGlobalObjectConsoleClient.cpp:
(Inspector::JSGlobalObjectConsoleClient::logToSystemConsole):
(Inspector::JSGlobalObjectConsoleClient::setLogToSystemConsole):
(Inspector::JSGlobalObjectConsoleClient::messageWithTypeAndLevel):
(Inspector::JSGlobalObjectConsoleClient::initializeLogToSystemConsole): Deleted.
Simplify access to the setting now that it doesn't need to
initialize its value from preferences.

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

5 years agoWeb Inspector: Auto-attach fails after r179562, initialization too late after dispatch
joepeck@webkit.org [Wed, 15 Apr 2015 00:27:26 +0000 (00:27 +0000)]
Web Inspector: Auto-attach fails after r179562, initialization too late after dispatch
https://bugs.webkit.org/show_bug.cgi?id=143682

Reviewed by Timothy Hatcher.

* inspector/remote/RemoteInspector.mm:
(Inspector::RemoteInspector::singleton):
If we are on the main thread, run the initialization immediately.
Otherwise dispatch to the main thread. This way if the first JSContext
was created on the main thread it can get auto-attached if applicable.

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

5 years agoRe-enable custom dilation for antialiased fonts
simon.fraser@apple.com [Wed, 15 Apr 2015 00:26:23 +0000 (00:26 +0000)]
Re-enable custom dilation for antialiased fonts
https://bugs.webkit.org/show_bug.cgi?id=143738

Reviewed by Tim Horton.

Enabling custom dilation for antialised fonts broke layout tests, so re-land it,
but disable in WebKitTestRunner and DumpRenderTree. The latter requires adding
a private WebKit pref. This pref defaults to YES, enabling the feature by default
in WK1 as we do for WK2.

Source/WebCore:

* platform/graphics/cocoa/FontCascadeCocoa.mm:
(WebCore::dilationSizeForTextColor):
(WebCore::FontCascade::drawGlyphs):

Source/WebKit/mac:

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences setAntialiasedFontDilationEnabled:]):
(-[WebPreferences antialiasedFontDilationEnabled]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Tools:

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

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

5 years ago[Content Filtering] Use ASSERT_WITH_SECURITY_IMPLICATION for verifying types from...
aestes@apple.com [Wed, 15 Apr 2015 00:20:54 +0000 (00:20 +0000)]
[Content Filtering] Use ASSERT_WITH_SECURITY_IMPLICATION for verifying types from NEFilterSource
https://bugs.webkit.org/show_bug.cgi?id=143742

Reviewed by David Kilzer.

* platform/cocoa/NetworkExtensionContentFilter.mm:
(replacementDataFromDecisionInfo): ASSERT_WITH_SECURITY_IMPLICATION that decisionInfo is really a NSDictionary.
(WebCore::NetworkExtensionContentFilter::handleDecision): ASSERT_WITH_SECURITY_IMPLICATION that replacementData is really a NSData.

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

5 years agoUpdate gesture swipe shadow style
timothy_horton@apple.com [Wed, 15 Apr 2015 00:02:53 +0000 (00:02 +0000)]
Update gesture swipe shadow style
https://bugs.webkit.org/show_bug.cgi?id=143616
<rdar://problem/19295843>

Reviewed by Darin Adler.

* UIProcess/mac/ViewGestureController.h:
* UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::ViewGestureController::beginSwipeGesture):
For the modern shadow style, use a layer stretched along the edge of the swiping content
with the newly added PNGs as the layer contents.

Add a dimming layer over the lower layer of content which fades in/out
during the swipe.

(WebKit::ViewGestureController::handleSwipeGesture):
Fade the dimming layer in and out during the entire swipe.
Fade the shadow layer out during the last few pixels of the swipe.

(WebKit::ViewGestureController::removeSwipeSnapshot):
Unparent the new layers.

* WebKit2.xcodeproj/project.pbxproj:
* Resources/SwipeShadow.png:
* Resources/SwipeShadow@2x.png:
Add the new resources.

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

5 years agoCorrect layering violation in DumpRenderTree Build
bfulgham@apple.com [Tue, 14 Apr 2015 23:48:00 +0000 (23:48 +0000)]
Correct layering violation in DumpRenderTree Build
https://bugs.webkit.org/show_bug.cgi?id=143732

Reviewed by Simon Fraser.

Source/WebCore:

* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::monitorWheelEvents): Added. Provides a wrapper around
the internal WebCore objects needed to implement this function.
(WebCoreTestSupport::setTestCallbackAndStartNotificationTimer): Ditto.
* testing/js/WebCoreTestSupport.h:

Tools:

Correct a layering violation in DumpRenderTree by calling functions on the
WebCoreTestSupport library, rather than attempting to work with WebCore
types directly.

* DumpRenderTree/mac/EventSendingController.mm:
(-[EventSendingController monitorWheelEvents]): Call methods on WebCoreTestSupport, rather
than WebCore itself.,
(-[EventSendingController callAfterScrollingCompletes:]): Ditto.

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

5 years agoMake sure media element loads hit content filter extensions.
beidson@apple.com [Tue, 14 Apr 2015 23:47:01 +0000 (23:47 +0000)]
Make sure media element loads hit content filter extensions.
<rdar://problem/20014012> and https://bugs.webkit.org/show_bug.cgi?id=143731

Reviewed by Jer Noble.

Source/WebCore:

Tests: http/tests/contentextensions/media-filtered.html
       http/tests/contentextensions/text-track-blocked.html

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::parseAttribute): Skip loads that are filtered.

LayoutTests:

* http/tests/contentextensions/media-filtered-expected.txt: Added.
* http/tests/contentextensions/media-filtered.html: Added.
* http/tests/contentextensions/media-filtered.html.json: Added.
* http/tests/contentextensions/text-track-blocked-expected.txt: Added.
* http/tests/contentextensions/text-track-blocked.html: Added.
* http/tests/contentextensions/text-track-blocked.html.json: Added.

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

5 years agoUnreviewed build fix for Mavericks.
joepeck@webkit.org [Tue, 14 Apr 2015 23:45:17 +0000 (23:45 +0000)]
Unreviewed build fix for Mavericks.

Mavericks includes this file but does not enable ENABLE_REMOTE_INSPECTOR
so the Inspector namespace is not available when compiling this file.

* API/JSRemoteInspector.cpp:

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

5 years ago[Win] Skip failling test due to list box scroll behavior.
bfulgham@apple.com [Tue, 14 Apr 2015 23:36:56 +0000 (23:36 +0000)]
[Win] Skip failling test due to list box scroll behavior.
https://bugs.webkit.org/show_bug.cgi?id=143739

* platform/win/TestExpectations:

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

5 years ago[Win] Unreviewed test correction after r182737.
bfulgham@apple.com [Tue, 14 Apr 2015 23:34:33 +0000 (23:34 +0000)]
[Win] Unreviewed test correction after r182737.

New test expectation was missing a newline at the end of the file.

* platform/win/printing/single-line-must-not-be-split-into-two-pages-expected.txt:

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

5 years agoWeb Inspector: Expose private APIs to interact with RemoteInspector instead of going...
joepeck@webkit.org [Tue, 14 Apr 2015 23:26:21 +0000 (23:26 +0000)]
Web Inspector: Expose private APIs to interact with RemoteInspector instead of going through WebKit
https://bugs.webkit.org/show_bug.cgi?id=143729

Reviewed by Timothy Hatcher.

* API/JSRemoteInspector.h: Added.
* API/JSRemoteInspector.cpp: Added.
(JSRemoteInspectorDisableAutoStart):
(JSRemoteInspectorStart):
(JSRemoteInspectorSetParentProcessInformation):
Add the new SPIs for basic remote inspection behavior.

* JavaScriptCore.xcodeproj/project.pbxproj:
Add the new files to Mac only, since remote inspection is only
enabled there anyways.

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

5 years agoAdd SPI to clear HSTS hosts added since a date.
bweinstein@apple.com [Tue, 14 Apr 2015 22:56:59 +0000 (22:56 +0000)]
Add SPI to clear HSTS hosts added since a date.
https://bugs.webkit.org/show_bug.cgi?id=143726
and
rdar://problem/16664597

Source/WebCore:

Declare _CFNetworkResetHSTSHostsSinceDate in CFNetworkSPI.h.

Reviewed by Anders Carlsson.

* platform/spi/cf/CFNetworkSPI.h:

Source/WebKit2:

Reviewed by Anders Carlsson.

* UIProcess/API/C/mac/WKContextPrivateMac.h:
* UIProcess/API/C/mac/WKContextPrivateMac.mm:
(WKContextResetHSTSHostsAddedAfterDate): Call into the WebProcessPool.
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::resetHSTSHostsAddedAfterDate): Call CFNetwork SPI to clear HSTS hosts added
after the given date.
* UIProcess/WebProcessPool.h:

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

5 years agoSet the font size to 11px explicitly to try to fix this test on Windows.
simon.fraser@apple.com [Tue, 14 Apr 2015 21:55:46 +0000 (21:55 +0000)]
Set the font size to 11px explicitly to try to fix this test on Windows.

* fast/forms/listbox-visible-size.html:

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

5 years agoUnreviewed. Time numbers on media controls move as they update on OSX.
roger_fong@apple.com [Tue, 14 Apr 2015 21:42:00 +0000 (21:42 +0000)]
Unreviewed. Time numbers on media controls move as they update on OSX.
<rdar://problem/20141790>.

* Modules/mediacontrols/mediaControlsApple.css:
(audio::-webkit-media-controls-current-time-display):
(audio::-webkit-media-controls-time-remaining-display):
Don't bother justifying content to end. We size the box to fit the time displays exactly anyways.

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

5 years agoInsert volume control in correct place after exiting wireless play.
roger_fong@apple.com [Tue, 14 Apr 2015 21:35:02 +0000 (21:35 +0000)]
Insert volume control in correct place after exiting wireless play.
        https://bugs.webkit.org/show_bug.cgi?id=143721.
        <rdar://problem/20526106>

        Reviewed by Darin Adler.

        * Modules/mediacontrols/mediaControlsApple.js:
        (Controller.prototype.updateWirelessPlaybackStatus):

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

5 years agoRename JSC_dfgFunctionWhitelistFile to JSC_dfgWhitelist.
mark.lam@apple.com [Tue, 14 Apr 2015 21:25:22 +0000 (21:25 +0000)]
Rename JSC_dfgFunctionWhitelistFile to JSC_dfgWhitelist.
https://bugs.webkit.org/show_bug.cgi?id=143722

Reviewed by Michael Saboff.

Renaming JSC_dfgFunctionWhitelistFile to JSC_dfgWhitelist so that it is
shorter, and easier to remember (without having to look it up) and to
type.  JSC options now support descriptions, and one can always look up
the description if the option's purpose is not already obvious.

* dfg/DFGFunctionWhitelist.cpp:
(JSC::DFG::FunctionWhitelist::ensureGlobalWhitelist):
(JSC::DFG::FunctionWhitelist::contains):
* runtime/Options.h:

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

5 years agoMedia elements not in a page shouldn't load.
beidson@apple.com [Tue, 14 Apr 2015 21:24:45 +0000 (21:24 +0000)]
Media elements not in a page shouldn't load.
https://bugs.webkit.org/show_bug.cgi?id=143720

Reviewed by Jer Noble.

No new tests (Theoretical problem noticed in code review).

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::loadResource): Make sure the frame is in a page.

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

5 years ago[iOS] Clean up registration of layers with the ScrollingCoordinator
simon.fraser@apple.com [Tue, 14 Apr 2015 21:14:07 +0000 (21:14 +0000)]
[iOS] Clean up registration of layers with the ScrollingCoordinator
https://bugs.webkit.org/show_bug.cgi?id=143725

Reviewed by Tim Horton.

Simplify a couple of bits of code related to the registration of layers with
the ScrollingCoordinator in RenderLayerCompositor.

First, RenderLayerBacking was using ScrollingNodeTypes to choose which scrolling
roles a layer has, which let to ambiguous code where we hardcoded a ScrollingNodeType
with knowledge of what RenderLayerBacking did with it. Clean up by using LayerScrollCoordinationRole,
which is moved to RenderLayer.h so that RenderLayerCompositor.h and RenderLayerBacking.h
both see it.

Secondly, avoid having both detachFromScrollingCoordinator() and detachFromScrollingCoordinatorForRole()
by passing in the bitmask of roles.

* page/FrameView.cpp:
(WebCore::FrameView::scrollLayerID):
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::~RenderLayerBacking):
(WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
(WebCore::RenderLayerBacking::detachFromScrollingCoordinatorForRole): Deleted.
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
(WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers):
(WebCore::scrollCoordinationRoleForNodeType):
(WebCore::RenderLayerCompositor::attachScrollingNode):
(WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
(WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
(WebCore::RenderLayerCompositor::detachScrollCoordinatedLayerForRole): Deleted.
* rendering/RenderLayerCompositor.h:

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

5 years agoAdd a conservative DFA minimizer for the content extension matcher
benjamin@webkit.org [Tue, 14 Apr 2015 21:08:02 +0000 (21:08 +0000)]
Add a conservative DFA minimizer for the content extension matcher
https://bugs.webkit.org/show_bug.cgi?id=143501

Reviewed by Alex Christensen.

Source/WebCore:

This patch adds a simple minimizer for DFA graphs. It is not a perfect minimizer:
some indistinguishable are not merged, but no two distinguishable are merged.

The general idea of the algorithm is to put all the state into a single set
and partition iteratively until it is impossible to split any subset by using
a transition to distinguish two states.

Let's ignore fallback transition for now, and I'll explain later how they fit in
the big picture.

The first thing we do is create a partition of the transition by grouping every
transition by the same character in the same subset. This partition of transitions
is the base by which we will partition the states.

Each subset in the transition partition is a "distinguisher" by which we can
separate the state partition.

We also create a second partition, the state partition. This is where we keep
all the subsets of states that have been split so far.

Let say we have the following graph.

    1 --a--> 2
    1 --b--> 3
    2 --c--> 4 (final)
    3 --c--> 4 (final)

The partition of transition would start with:
Set 0:
    1 --a--> 2
Set 1:
    1 --b--> 3
Set 2:
    2 --c--> 4
    3 --c--> 4

The state partition would have a single set with { 1, 2, 3, 4 }.

Next, we split the state partition by distinguishable final states. In this case,
we would split it into { 1, 2, 3 }, { 4 }.

We then refine the transition partition by splitting it by the states that have
been distinguished. Here, the only transitions to 4 are both is the same set (set 2),
so the transition partition remains the same.

We can now execute the main loop of the algorithm:
1) Split the states by the transitions.
2) Split the transitions that are now reaching two different sets of the state partition.
3) Add any newly discovered "distinguisher" (the ones we split) to the list of "distinguisher"
   to process.

In this case, we just iterate over the partition set in order, and add newly split transitions
to the end of the list.

In the example, we would first visit set 0. We have that state 1 is distinguishable
by "a", and the state partition would become { 1 }, { 2, 3 }, { 4 }.

We then visit transition set 1, it distinguishes state 1 which is already alone -> nothing to do.

Finally, we process the transition set 2, it distinguishes 2 and 3, they are already in the same
set -> nothing to do.

There is no more transition to process, we have 3 unique subsets and we should merge 2 and 3.

---

Okay, now how to we fit fallback transition in this model. In this patch, I take the conservative
approach: we split everything assuming fallback transition do not exist, then we refine
by the fallback transitions.

Let's take the following example:
    1 --a--> 3
    2 --a--> 3
    1 -[f]-> 4
    2 -[f]-> 5

and at this stage in the algorithm, we have the sets { 1, 2 }, { 3 }, { 4 }, { 5 }.
The states 1 and 2 are together because they cannot be distinguished by 'a', but
the fallback transition distinguishes them.

Since we have done every other split, we have one useful property: we know that every
state in every set transition with the exact set of characters within that set.
If that was not true, there would be one "distinguisher" 'x' that could spit the set
into two subsets: the one with the transition 'x' and the ones without.

Since all the transitions are the same, there is no overlap between the defined transition
and the fallback transition. Consequently, we can use the fallback transition as a whole
transition and use it to distinguish the states.

The fallback transitions are handled like any other transition, we have a partition of such
transitions and split by each of them. BUT, we can only use them after every unique transition
has been covered.

This trick is also what makes the minimization imperfect: it should be possible to merge
states with overlap in their fallback transitions but we would split them.

---

Antti Valmari, Petri Lehtinen, Marie-Pierre Béal and Maxime Crochemore deserve credit for their indirect
work on this patch. Thanks for your wonderful papers about DFA minimization.

* WebCore.xcodeproj/project.pbxproj:
* contentextensions/ContentExtensionCompiler.cpp:
(WebCore::ContentExtensions::compileRuleList):
* contentextensions/DFA.cpp:
(WebCore::ContentExtensions::DFA::minimize):
(WebCore::ContentExtensions::DFA::debugPrintDot):
* contentextensions/DFA.h:
* contentextensions/DFABytecodeCompiler.cpp:
(WebCore::ContentExtensions::DFABytecodeCompiler::compileNode):
* contentextensions/DFAMinimizer.cpp: Added.
(WebCore::ContentExtensions::DFAMinimizer::simplifyTransitions):
(WebCore::ContentExtensions::DFAMinimizer::Partition::initialize):
(WebCore::ContentExtensions::DFAMinimizer::Partition::markElementInCurrentGeneration):
(WebCore::ContentExtensions::DFAMinimizer::Partition::refineGeneration):
(WebCore::ContentExtensions::DFAMinimizer::Partition::iterateSet):
(WebCore::ContentExtensions::DFAMinimizer::Partition::setIndex):
(WebCore::ContentExtensions::DFAMinimizer::Partition::firstElementInSet):
(WebCore::ContentExtensions::DFAMinimizer::Partition::size):
(WebCore::ContentExtensions::DFAMinimizer::Partition::SetDescriptor::indexAfterMarkedElements):
(WebCore::ContentExtensions::DFAMinimizer::Partition::SetDescriptor::end):
(WebCore::ContentExtensions::DFAMinimizer::FullGraphPartition::FullGraphPartition):
(WebCore::ContentExtensions::DFAMinimizer::FullGraphPartition::markNode):
(WebCore::ContentExtensions::DFAMinimizer::FullGraphPartition::refinePartitions):
(WebCore::ContentExtensions::DFAMinimizer::FullGraphPartition::splitByUniqueTransitions):
(WebCore::ContentExtensions::DFAMinimizer::FullGraphPartition::splitByFallbackTransitions):
(WebCore::ContentExtensions::DFAMinimizer::FullGraphPartition::nodeReplacement):
(WebCore::ContentExtensions::DFAMinimizer::ActionKey::ActionKey):
(WebCore::ContentExtensions::DFAMinimizer::ActionKey::isEmptyValue):
(WebCore::ContentExtensions::DFAMinimizer::ActionKey::isDeletedValue):
(WebCore::ContentExtensions::DFAMinimizer::ActionKeyHash::hash):
(WebCore::ContentExtensions::DFAMinimizer::ActionKeyHash::equal):
(WebCore::ContentExtensions::DFAMinimizer::minimize):
* contentextensions/DFAMinimizer.h: Copied from Source/WebCore/contentextensions/DFA.h.
* contentextensions/DFANode.h:
* contentextensions/NFAToDFA.cpp:
(WebCore::ContentExtensions::NFAToDFA::convert):
(WebCore::ContentExtensions::simplifyTransitions): Deleted.

Tools:

* TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp:
* TestWebKitAPI/Tests/WebCore/DFAMinimizer.cpp:

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

5 years agoASSERT(frame().view() == this) assertion hit in FrameView::windowClipRect() on Window...
cdumez@apple.com [Tue, 14 Apr 2015 20:54:36 +0000 (20:54 +0000)]
ASSERT(frame().view() == this) assertion hit in FrameView::windowClipRect() on Windows bots
https://bugs.webkit.org/show_bug.cgi?id=143723

Reviewed by Brent Fulgham.

ASSERT(frame().view() == this) in FrameView::windowClipRect() can be hit
if the post layout timer timer fires after the page has entered page
cache. Upon entering page cache, we call FrameView::unscheduleRelayout()
to stop the layout timer if it is active, however, we don't stop the
post-layout timer. Therefore, there was nothing preventing the
post-layout timer from firing after entering page cache.

In this patch, we unschedule the post-layout timer in
FrameView::unscheduleRelayout() to protect ourselves against this.

I think we were only seeing the assertion hit on Windows because this
timer probably gets scheduled more frequently on Windows. On Mac, I
rarely see it getting scheduled.

No new tests, should fix crashing tests on the bots.

* page/FrameView.cpp:
(WebCore::FrameView::unscheduleRelayout):

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

5 years agoinspector/console/console-api.html is very slow, frequently timing out
ap@apple.com [Tue, 14 Apr 2015 19:35:32 +0000 (19:35 +0000)]
inspector/console/console-api.html is very slow, frequently timing out
https://bugs.webkit.org/show_bug.cgi?id=143719

* TestExpectations: Marking as slow.

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

5 years agoFrameView::m_frame should be a Ref<Frame>
cdumez@apple.com [Tue, 14 Apr 2015 19:22:35 +0000 (19:22 +0000)]
FrameView::m_frame should be a Ref<Frame>
https://bugs.webkit.org/show_bug.cgi?id=143716

Reviewed by Andreas Kling.

FrameView::m_frame should be a Ref<Frame> instead of a RefPtr<Frame> as
it can never be null.

* page/FrameView.cpp:
(WebCore::FrameView::FrameView):
(WebCore::FrameView::flushCompositingStateForThisFrame):
(WebCore::FrameView::hasCompositedContentIncludingDescendants):
(WebCore::FrameView::flushCompositingStateIncludingSubframes):
(WebCore::FrameView::updateCanBlitOnScrollRecursively):
(WebCore::FrameView::setIsOverlapped):
(WebCore::FrameView::shouldUpdateCompositingLayersAfterScrolling):
(WebCore::FrameView::renderedCharactersExceed):
(WebCore::FrameView::updateLayerFlushThrottling):
(WebCore::FrameView::serviceScriptedAnimations):
(WebCore::FrameView::updateBackgroundRecursively):
(WebCore::FrameView::adjustScrollStepForFixedContent):
(WebCore::FrameView::paintContentsForSnapshot):
(WebCore::FrameView::notifyWidgetsInAllFrames):
(WebCore::FrameView::setExposedRect):
(WebCore::FrameView::setViewportSizeForCSSViewportUnits):
* page/FrameView.h:

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

5 years agoMore work on making the SharedMemory interface more sane
andersca@apple.com [Tue, 14 Apr 2015 19:15:28 +0000 (19:15 +0000)]
More work on making the SharedMemory interface more sane
https://bugs.webkit.org/show_bug.cgi?id=143718

Reviewed by Andreas Kling.

Get rid of m_shouldVMDeallocateData. The idea is that shared memory created by calling
SharedMemory::allocate has a non-null m_data pointer, and a null m_port. Shared memory created
by calling SharedMemory::create with a pointer and a length has a non-null port but a null m_data
since the data can be unmapped by the caller and we don't want to hold on to dangling pointers.

* Platform/SharedMemory.h:
(WebKit::SharedMemory::data):
* Platform/mac/SharedMemoryMac.cpp:
(WebKit::SharedMemory::allocate):
(WebKit::SharedMemory::create):
(WebKit::SharedMemory::map):
(WebKit::SharedMemory::~SharedMemory):
(WebKit::SharedMemory::createHandle):

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

5 years agoNetwork Cache: Deduplicate body data
antti@apple.com [Tue, 14 Apr 2015 18:40:27 +0000 (18:40 +0000)]
Network Cache: Deduplicate body data
https://bugs.webkit.org/show_bug.cgi?id=143652

Reviewed by Darin Adler.

It is common to have cache entries with identical body data. This happens when the same resource is loaded from
a different URL (https vs http, slash vs no-slash at end, etc.). It also happens when the same URL is
referenced from different cache partitions.

We can improve disk space efficiency and use less memory by sharing identical body data between cache entries.

This patch splits the body data out from the record file. The new record file contains meta data and response
headers only. Body data is stored using the new BlobStorage interface. Files are deduplicated by computing
SHA1 hash over the data and looking for an existing blob with the same hash. If found the existing entry
is reused by creating a hard link to it.

The new disk structure looks like this:

WebKitCache/
    Version 3/
        Blobs/
            0A3C9A970ADA27FAE9BD7BC630BAD0B929C293C0
            0A6B8060BA77DF92C82A2FD7AF58F79524D8F34C
            ...
        Records/
            apple.com/
                0B8645B04E7EC78C178B7460052601C2
                0B8645B04E7EC78C178B7460052601C2-body
                0CB1A3638D1C5A09C5E3283A74FA040B
                0CB1A3638D1C5A09C5E3283A74FA040B-body
                ...

Each record file has an associated -body which is a hard link to a file in the Blobs directory.

The patch increases effective capacity by 10-20% with a typical cache. It also saves memory especially when identical
resources are used in multiple tabs.

Currently all >0 sized resources are stored as shared blobs. In future small resources should be integrated into record
files and blobs used for larger files only.

* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::store):
(WebKit::NetworkCache::Cache::update):

    Adopt the new storage interface.

(WebKit::NetworkCache::Cache::dumpContentsToFile):
* NetworkProcess/cache/NetworkCacheBlobStorage.cpp: Added.
(WebKit::NetworkCache::BlobStorage::BlobStorage):
(WebKit::NetworkCache::BlobStorage::synchronize):

    Compute size and delete unused files from the Blobs directory (link count == 1).

(WebKit::NetworkCache::BlobStorage::blobPath):
(WebKit::NetworkCache::BlobStorage::add):
(WebKit::NetworkCache::BlobStorage::get):

    Interface for storing and retrieving data blobs. Blobs are deduplicated on add.

(WebKit::NetworkCache::BlobStorage::remove):

    Removes the link but doesn't remove the blob even if there are no other clients. That happens on next synchronize().

(WebKit::NetworkCache::BlobStorage::shareCount):

    Checks the link count to get the number of clients.

* NetworkProcess/cache/NetworkCacheBlobStorage.h: Added.
(WebKit::NetworkCache::BlobStorage::approximateSize):
* NetworkProcess/cache/NetworkCacheCoders.cpp:
(WebKit::NetworkCache::Coder<SHA1::Digest>::encode):
(WebKit::NetworkCache::Coder<SHA1::Digest>::decode):
* NetworkProcess/cache/NetworkCacheCoders.h:
* NetworkProcess/cache/NetworkCacheData.h:
(WebKit::NetworkCache::Data::isEmpty):
* NetworkProcess/cache/NetworkCacheDataCocoa.mm:
(WebKit::NetworkCache::Data::empty):
(WebKit::NetworkCache::Data::fromMap):
(WebKit::NetworkCache::mapFile):
(WebKit::NetworkCache::computeSHA1):
(WebKit::NetworkCache::bytesEqual):

    Add some helpers.

* NetworkProcess/cache/NetworkCacheEntry.cpp:
(WebKit::NetworkCache::Entry::asJSON):
* NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
(WebKit::NetworkCache::IOChannel::IOChannel):
* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::makeRecordDirectoryPath):
(WebKit::NetworkCache::makeBlobDirectoryPath):
(WebKit::NetworkCache::Storage::Storage):
(WebKit::NetworkCache::Storage::approximateSize):
(WebKit::NetworkCache::Storage::synchronize):
(WebKit::NetworkCache::partitionPathForKey):
(WebKit::NetworkCache::recordPathForKey):
(WebKit::NetworkCache::bodyPath):
(WebKit::NetworkCache::decodeRecordMetaData):
(WebKit::NetworkCache::decodeRecordHeader):
(WebKit::NetworkCache::createRecord):
(WebKit::NetworkCache::encodeRecordMetaData):
(WebKit::NetworkCache::encodeRecordHeader):
(WebKit::NetworkCache::Storage::remove):
(WebKit::NetworkCache::Storage::updateFileModificationTime):
(WebKit::NetworkCache::Storage::dispatchReadOperation):

    Read both the blob and the record entry.

(WebKit::NetworkCache::Storage::finishReadOperation):

    Factor to a function.

(WebKit::NetworkCache::Storage::store):
(WebKit::NetworkCache::Storage::traverse):
(WebKit::NetworkCache::Storage::dispatchPendingWriteOperations):
(WebKit::NetworkCache::Storage::dispatchWriteOperation):

    We don't need separate full write and header write paths anymore. Everything is treated
    as a full write and deduplication stops us writing the body again.

    This simplifies the code and data structures.

(WebKit::NetworkCache::Storage::finishWriteOperation):

    Factor to a function.

(WebKit::NetworkCache::Storage::clear):
(WebKit::NetworkCache::deletionProbability):

    Take the sharing count into account when computing deletion probability.
    It is less useful to delete a record that shares its body with others as data won't get deleted.

(WebKit::NetworkCache::Storage::shrinkIfNeeded):
(WebKit::NetworkCache::Storage::shrink):
(WebKit::NetworkCache::Storage::deleteOldVersions):
(WebKit::NetworkCache::directoryPathForKey): Deleted.
(WebKit::NetworkCache::filePathForKey): Deleted.
(WebKit::NetworkCache::openFileForKey): Deleted.
(WebKit::NetworkCache::decodeRecord): Deleted.
(WebKit::NetworkCache::Storage::update): Deleted.

    No need for separate update interface anymore. Regular store() avoids unnecessary body write.

(WebKit::NetworkCache::Storage::dispatchFullWriteOperation): Deleted.
(WebKit::NetworkCache::Storage::dispatchHeaderWriteOperation): Deleted.
* NetworkProcess/cache/NetworkCacheStorage.h:
* WebKit2.xcodeproj/project.pbxproj:

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

5 years agoSkip failing test Tests/WebKit2Cocoa/FixedLayoutSize.mm on iOS
dbates@webkit.org [Tue, 14 Apr 2015 17:57:36 +0000 (17:57 +0000)]
Skip failing test Tests/WebKit2Cocoa/FixedLayoutSize.mm on iOS
https://bugs.webkit.org/show_bug.cgi?id=143693
<rdar://problem/20530316>

Reviewed by Tim Horton.

Skip the test Tests/WebKit2Cocoa/FixedLayoutSize.mm as we do not plan
to use the fixed layout code on iOS at this time.

* TestWebKitAPI/Tests/WebKit2Cocoa/FixedLayoutSize.mm: Add !PLATFORM(IOS)-guard.

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

5 years agofast/sub-pixel/input-caret-on-subpixel-bound.html is flaky
ap@apple.com [Tue, 14 Apr 2015 17:34:03 +0000 (17:34 +0000)]
fast/sub-pixel/input-caret-on-subpixel-bound.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=143697

Reviewed by Anders Carlsson.

* fast/sub-pixel/input-caret-on-subpixel-bound.html: Don't wait for a timer to fire
after removing the last character.

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

5 years agoTwo flaky tests in http/tests/security/mixedContent
ap@apple.com [Tue, 14 Apr 2015 17:30:42 +0000 (17:30 +0000)]
Two flaky tests in http/tests/security/mixedContent
https://bugs.webkit.org/show_bug.cgi?id=143695

Reviewed by Csaba Osztrogonác.

Speculative fix. Do not start opening a secondary window until fully done with the
main document.

* http/tests/security/mixedContent/data-url-iframe-in-main-frame-expected.txt:
* http/tests/security/mixedContent/data-url-iframe-in-main-frame.html:
* http/tests/security/mixedContent/insecure-css-in-main-frame-expected.txt:
* http/tests/security/mixedContent/insecure-css-in-main-frame.html:

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

5 years ago[iOS WK2] Interactive elements of developer.apple.com are broken
simon.fraser@apple.com [Tue, 14 Apr 2015 17:25:31 +0000 (17:25 +0000)]
[iOS WK2] Interactive elements of developer.apple.com are broken
https://bugs.webkit.org/show_bug.cgi?id=143692
Source/WebCore:

rdar://problem/19320087

Reviewed by Sam Weinig.

When a composited RenderLayer had nodes in the scrolling tree by virtue of
both position and overflow:scroll, and one of those reasons disappeared,
we'd fail to remove the corresponding node from the scrolling tree. This
could leave an overflow:scroll element behaving as if it were position:fixed.

Fix by having RenderLayerCompositor::updateScrollCoordinationForThisFrame()
detach the layer on a per-role basis.

Test: platform/ios-simulator-wk2/scrolling/remove-scrolling-role.html

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::detachFromScrollingCoordinatorForRole):
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::detachScrollCoordinatedLayerForRole):
(WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer): Just moved.
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): Call detachScrollCoordinatedLayerForRole()
if the layer doesn't have the relevant scrolling reasons.
* rendering/RenderLayerCompositor.h:

LayoutTests:

Reviewed by Sam Weinig.

* platform/ios-simulator-wk2/scrolling/remove-scrolling-role-expected.txt: Added.
* platform/ios-simulator-wk2/scrolling/remove-scrolling-role.html: Added.

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

5 years agoREGRESSION(r182603): [GTK] More than 500 crashes on the layout tests with the debug...
cdumez@apple.com [Tue, 14 Apr 2015 17:07:11 +0000 (17:07 +0000)]
REGRESSION(r182603): [GTK] More than 500 crashes on the layout tests with the debug build.
https://bugs.webkit.org/show_bug.cgi?id=143715

Reviewed by Darin Adler.

Enable assertions checking that calling editorState() does not cause a
synchronous layout only on Mac and iOS. This assertion does not
necessarily hold true on other ports as each one as its own
platformEditorState() implementation. In particular, this assertion
was being hit on GTK.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didChangeSelection):

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

5 years agoUnreviewed, rolling out r182794.
commit-queue@webkit.org [Tue, 14 Apr 2015 16:13:32 +0000 (16:13 +0000)]
Unreviewed, rolling out r182794.
https://bugs.webkit.org/show_bug.cgi?id=143714

readable-stream-templated.html fails on Debug bots (Requested
by youenn on #webkit).

Reverted changeset:

"[Streams API] ReadableStream constructor start function
should be able to close the stream"
https://bugs.webkit.org/show_bug.cgi?id=143363
http://trac.webkit.org/changeset/182794

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

5 years agoWeb Inspector: Align array's indices and set's bullet points under the property icon
nvasilyev@apple.com [Tue, 14 Apr 2015 15:15:35 +0000 (15:15 +0000)]
Web Inspector: Align array's indices and set's bullet points under the property icon
https://bugs.webkit.org/show_bug.cgi?id=143698

Reviewed by Timothy Hatcher.

* UserInterface/Views/ObjectTreeMapEntryTreeElement.css:
(.object-tree-array-index.object-tree-map-entry > .titles > .title > .index-name):
* UserInterface/Views/ObjectTreeArrayIndexTreeElement.css:
(.object-tree-array-index .index-name):
Right align array's and set's indices.

(.object-tree-map-entry):
Overwrite left property from .object-tree-array-index.

(.object-tree-property + ol .object-tree-map-entry):
Overwrite left property from .object-tree-property + ol .object-tree-array-index.

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

5 years ago[WinCairo] Unreviewed build fix after r182707.
peavo@outlook.com [Tue, 14 Apr 2015 13:59:36 +0000 (13:59 +0000)]
[WinCairo] Unreviewed build fix after r182707.

* platform/network/curl/MultipartHandle.cpp:
(WebCore::MultipartHandle::didReceiveResponse):

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

5 years ago[Streams API] ReadableStream constructor start function should be able to close the...
youenn.fablet@crf.canon.fr [Tue, 14 Apr 2015 13:52:59 +0000 (13:52 +0000)]
[Streams API] ReadableStream constructor start function should be able to close the stream
https://bugs.webkit.org/show_bug.cgi?id=143363

Reviewed by Benjamin Poulain.

Source/WebCore:

Implements https://streams.spec.whatwg.org/#close-readable-stream.
When the "close" JS function is called, the stream is getting closed.
The stream state is changed to close and if it has a reader, the reader gets closed as well:
The reader resolves the closed promise and release the stream.

Enabled the possibility to resolve a promise with any JS value.
This is used to resolve closed promise with jsUndefined and will be used for read promises.

Covered by reference tests that are now passing.

* Modules/streams/ReadableStream.cpp:
(WebCore::ReadableStream::changeStateToClosed): Called by the JS function 'close'.
* Modules/streams/ReadableStream.h:
* Modules/streams/ReadableStreamReader.cpp:
(WebCore::ReadableStreamReader::ReadableStreamReader):
(WebCore::ReadableStreamReader::initialize): Added to handle state change at constructor time (in particular closed/errored state).
(WebCore::ReadableStreamReader::releaseStream):
(WebCore::ReadableStreamReader::closed): Storing the closed promise callbacks.
(WebCore::ReadableStreamReader::changeStateToClosed): Resolution of closed promise.
* Modules/streams/ReadableStreamReader.h:
* bindings/js/JSDOMPromise.h:
(WebCore::DeferredWrapper::resolve<JSC::JSValue>):
* bindings/js/JSReadableStreamReaderCustom.cpp:
(WebCore::JSReadableStreamReader::closed):
* bindings/js/ReadableStreamJSSource.cpp:
(WebCore::readableStreamSlotName):
(WebCore::getReadableJSStream): Helper function to retrieve the stream from the exec state.
(WebCore::closeReadableStreamFunction):
(WebCore::createReadableStreamCloseFunction):
(WebCore::createReadableStreamController):
(WebCore::ReadableStreamJSSource::start):
(WebCore::ReadableJSStreamReader::ReadableJSStreamReader): Deleted.

LayoutTests:

Rebased tests as some are now passing.

* streams/reference-implementation/readable-stream-reader-expected.txt:
* streams/reference-implementation/readable-stream-templated-expected.txt:

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

5 years ago[GTK] Gardening 14th April
commit-queue@webkit.org [Tue, 14 Apr 2015 13:10:30 +0000 (13:10 +0000)]
[GTK] Gardening 14th April
https://bugs.webkit.org/show_bug.cgi?id=143701

Unreviewed.

Patch by Marcos Chavarría Teijeiro <chavarria1991@gmail.com> on 2015-04-14

* platform/gtk/TestExpectations:
* platform/gtk/http/tests/w3c/webperf/approved/navigation-timing/html/test_timing_xserver_redirect-expected.txt:

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

5 years ago[GTK] Gardening: Rebaseline tests after r182620
commit-queue@webkit.org [Tue, 14 Apr 2015 13:08:23 +0000 (13:08 +0000)]
[GTK] Gardening: Rebaseline tests after r182620
https://bugs.webkit.org/show_bug.cgi?id=143700

Unreviewed.

This revision updates some tests after changing the way <br> is
rendered. We need to change the GTK+ expectations for these tests.

Patch by Marcos Chavarría Teijeiro <chavarria1991@gmail.com> on 2015-04-14

* platform/gtk/fast/css/text-overflow-ellipsis-bidi-expected.txt:
* platform/gtk/fast/dom/focus-contenteditable-expected.txt:
* platform/gtk/fast/forms/listbox-hit-test-zoomed-expected.png:
* platform/gtk/fast/forms/listbox-hit-test-zoomed-expected.txt:
* platform/gtk/fast/forms/range/slider-padding-expected.txt:
* platform/gtk/fast/forms/textarea-scroll-height-expected.txt:
* platform/gtk/fast/parser/open-comment-in-textarea-expected.txt:
* platform/gtk/fast/text/international/bidi-layout-across-linebreak-expected.txt:
* platform/gtk/http/tests/navigation/javascriptlink-frames-expected.txt:
* platform/gtk/http/tests/navigation/postredirect-basic-expected.txt:
* platform/gtk/http/tests/navigation/postredirect-goback1-expected.txt:
* platform/gtk/svg/wicd/test-rightsizing-b-expected.txt:
* platform/gtk/tables/mozilla/bugs/bug106795-expected.txt:
* platform/gtk/tables/mozilla/bugs/bug1224-expected.txt:
* platform/gtk/tables/mozilla/bugs/bug131020-expected.txt:
* platform/gtk/tables/mozilla/bugs/bug131020_iframe-expected.txt:
* platform/gtk/tables/mozilla/bugs/bug1430-expected.txt:
* platform/gtk/tables/mozilla/bugs/bug16252-expected.txt:
* platform/gtk/tables/mozilla/bugs/bug19599-expected.txt:
* platform/gtk/tables/mozilla/bugs/bug20579-expected.txt:
* platform/gtk/tables/mozilla/bugs/bug32205-3-expected.txt:
* platform/gtk/tables/mozilla/bugs/bug82946-2-expected.txt:
* platform/gtk/tables/mozilla/bugs/bug92143-expected.txt:
* platform/gtk/tables/mozilla/marvin/tables_cellpadding-expected.txt:
* platform/gtk/tables/mozilla/marvin/tables_cellspacing-expected.txt:
* platform/gtk/tables/mozilla/other/wa_table_thtd_rowspan-expected.txt:
* platform/gtk/tables/mozilla_expected_failures/bugs/bug1262-expected.txt:
* platform/gtk/tables/mozilla_expected_failures/bugs/bug56024-expected.txt:
* platform/gtk/tables/mozilla_expected_failures/other/test4-expected.txt:

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

5 years agoRemove myself from watchlist, remove empty Cairo and HarfBuzz watchlists
dominik.rottsches@intel.com [Tue, 14 Apr 2015 11:27:44 +0000 (11:27 +0000)]
Remove myself from watchlist, remove empty Cairo and HarfBuzz watchlists
https://bugs.webkit.org/show_bug.cgi?id=143705

Unreviewed change to watchlist file.

* Scripts/webkitpy/common/config/watchlist:

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

5 years ago[EFL] favicon wasn't updated for google.com sometimes.
hyuki.kim@samsung.com [Tue, 14 Apr 2015 11:01:09 +0000 (11:01 +0000)]
[EFL] favicon wasn't updated for google.com sometimes.
https://bugs.webkit.org/show_bug.cgi?id=141940

Reviewed by Gyuyoung Kim.

As elm_entry_utf8_to_markup can include additional characters, parameter for the
on_icon_changed_cb was just set by using url string retrieved by ewk_view_url_get().

* MiniBrowser/efl/main.c:
(on_url_changed):

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

5 years agoSync Streams API tests with spec
calvaris@igalia.com [Tue, 14 Apr 2015 08:20:40 +0000 (08:20 +0000)]
Sync Streams API tests with spec
https://bugs.webkit.org/show_bug.cgi?id=143669

Reviewed by Darin Adler.

Some tests were moved from the spec tests to our custom ones
because they were not approved (yet, or they won't be).

Some nuances from the spec tests were also fixed.

* streams/readable-stream-expected.txt: Added.
* streams/readable-stream-reader-expected.txt: Added.
* streams/readable-stream-reader.html: Added.
* streams/readable-stream.html: Added.
* streams/reference-implementation/readable-stream-expected.txt:
* streams/reference-implementation/readable-stream-reader-expected.txt:
* streams/reference-implementation/readable-stream-reader.html:
* streams/reference-implementation/readable-stream.html: Nuances
fixed and tests moved to custom.

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

5 years agoUse modern for-loops in Document
commit-queue@webkit.org [Tue, 14 Apr 2015 05:48:23 +0000 (05:48 +0000)]
Use modern for-loops in Document
https://bugs.webkit.org/show_bug.cgi?id=143600

Patch by Joonghun Park <jh718.park@samsung.com> on 2015-04-13
Reviewed by Darin Adler.

No new tests, no behavior changes.

* dom/Document.cpp:
(WebCore::Document::visibilityStateChanged):
(WebCore::Document::processBaseElement):
(WebCore::Document::moveNodeIteratorsToNewDocument):
(WebCore::Document::updateRangesAfterChildrenChanged):
(WebCore::Document::nodeChildrenWillBeRemoved):
(WebCore::Document::nodeWillBeRemoved):
(WebCore::Document::textInserted):
(WebCore::Document::textRemoved):
(WebCore::Document::textNodesMerged):
(WebCore::Document::textNodeSplit):
(WebCore::Document::documentWillSuspendForPageCache):
(WebCore::Document::documentDidResumeFromPageCache):
(WebCore::Document::mediaVolumeDidChange):
(WebCore::Document::privateBrowsingStateDidChange):
(WebCore::Document::captionPreferencesChanged):
(WebCore::Document::validateAutoSizingNodes):
(WebCore::Document::resetAutoSizingNodes):
(WebCore::Document::webkitExitFullscreen):
(WebCore::Document::absoluteRegionForEventTargets):

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

5 years agoBuild fixes after r182772.
ap@apple.com [Tue, 14 Apr 2015 05:10:09 +0000 (05:10 +0000)]
Build fixes after r182772.

* UIProcess/API/mac/WKView.mm:
(-[WKView _updateAutomaticallyComputedFixedLayoutSize]): Make a CGSize, not an NSSize.
(-[WKView _setAutomaticallyComputesFixedLayoutSizeFromViewScale:]): Moved implementation
to the correct place.
(-[WKView _automaticallyComputesFixedLayoutSizeFromViewScale]): Ditto.
(-[WKView _layoutMode]): Use a memeber from _data directly, not via a method.

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

5 years ago[CSS Grid Layout] Columns set in percentages collapse to auto width
rego@igalia.com [Tue, 14 Apr 2015 04:59:09 +0000 (04:59 +0000)]
[CSS Grid Layout] Columns set in percentages collapse to auto width
https://bugs.webkit.org/show_bug.cgi?id=141435

Reviewed by David Hyatt.

Source/WebCore:

Based on a patch by Sergio Villar Senin  <svillar@igalia.com>.

This patch adds 2 new new methods in RenderBox to determine if the grid
has a definite size or not.

RenderGrid::gridTrackSize() was not checking properly if the grid has or
not an indefinite size.
The condition was including auto which is not indefinite per se. For
example, auto is definite if the containing block is definite.
As the new method is more expensive, we just call it when it's really
needed to avoid performance regressions.

Finally we were setting the override logical width/height to -1 (no
possible resolution) for all the items regardless if they've a relative
width/height or a fixed one.
Added the condition, including not only items with percentage logical
width/height but also relative, to avoid overriding the value for items
with fixed width/height as it's not needed.

Tests: fast/css-grid-layout/grid-item-with-percent-height-in-auto-height-grid-resolution.html
       fast/css-grid-layout/percent-intrinsic-track-breadth.html
       fast/css-grid-layout/percent-track-breadths-regarding-container-size.html

* rendering/RenderBox.cpp:
(WebCore::logicalWidthIsResolvable):
(WebCore::RenderBox::hasDefiniteLogicalWidth):
(WebCore::RenderBox::percentageLogicalHeightIsResolvableFromBlock):
(WebCore::RenderBox::hasRelativeLogicalWidth):
* rendering/RenderBox.h:
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::hasDefiniteLogicalSize):
(WebCore::RenderGrid::gridTrackSize):
(WebCore::RenderGrid::logicalContentHeightForChild):
(WebCore::RenderGrid::minContentForChild):
(WebCore::RenderGrid::maxContentForChild):
* rendering/RenderGrid.h:

LayoutTests:

Added new tests to check that percentage track breadths are properly
calculated under different sizing conditions.
Modified one test to include relative sizes too.

* fast/css-grid-layout/grid-item-with-percent-height-in-auto-height-grid-resolution-expected.txt:
* fast/css-grid-layout/grid-item-with-percent-height-in-auto-height-grid-resolution.html:
* fast/css-grid-layout/percent-intrinsic-track-breadth-expected.txt: Added.
* fast/css-grid-layout/percent-intrinsic-track-breadth.html: Added.
* fast/css-grid-layout/percent-track-breadths-regarding-container-size-expected.txt: Added.
* fast/css-grid-layout/percent-track-breadths-regarding-container-size.html: Added.

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

5 years agoMore build fix.
ap@apple.com [Tue, 14 Apr 2015 03:24:39 +0000 (03:24 +0000)]
More build fix.

* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::setDragImage):

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

5 years agoWeb Inspector: Expanding window.navigator.mimeTypes in ObjectTree shows no native...
commit-queue@webkit.org [Tue, 14 Apr 2015 03:02:29 +0000 (03:02 +0000)]
Web Inspector: Expanding window.navigator.mimeTypes in ObjectTree shows no native properties
https://bugs.webkit.org/show_bug.cgi?id=143690

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-04-13
Reviewed by Timothy Hatcher.

* UserInterface/Views/ObjectTreePropertyTreeElement.js:
(WebInspector.ObjectTreePropertyTreeElement):
Fix a typo that resulted in hiding properties of native objects
in the Properties section of an Object Tree.

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

5 years agoWeb Inspector: Remove unnecessary 3 second delay when archiving page
commit-queue@webkit.org [Tue, 14 Apr 2015 03:00:50 +0000 (03:00 +0000)]
Web Inspector: Remove unnecessary 3 second delay when archiving page
https://bugs.webkit.org/show_bug.cgi?id=143688

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-04-13
Reviewed by Timothy Hatcher.

* UserInterface/Base/Main.js:
(WebInspector.archiveMainFrame):
The delay is unnecessary and was probably just debugging code.

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

5 years ago[EFL][GTK] Fix build break after r182753
commit-queue@webkit.org [Tue, 14 Apr 2015 02:44:52 +0000 (02:44 +0000)]
[EFL][GTK] Fix build break after r182753
https://bugs.webkit.org/show_bug.cgi?id=143689

Patch by Hunseop Jeong <hs85.jeong@samsung.com> on 2015-04-13
Reviewed by Anders Carlsson.

* Platform/IPC/unix/ConnectionUnix.cpp:
(IPC::Connection::processMessage):
(IPC::Connection::sendOutgoingMessage):
* Platform/unix/SharedMemoryUnix.cpp:
(WebKit::SharedMemory::allocate):
(WebKit::accessModeMMap):
(WebKit::SharedMemory::map):
(WebKit::SharedMemory::create): Deleted.

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

5 years agoBuild fix.
ap@apple.com [Tue, 14 Apr 2015 01:36:03 +0000 (01:36 +0000)]
Build fix.

* UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::setDragImage):

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

5 years agoKeep track of each shared memory object's protection when deciding whether to return...
andersca@apple.com [Tue, 14 Apr 2015 01:33:50 +0000 (01:33 +0000)]
Keep track of each shared memory object's protection when deciding whether to return our existing port
https://bugs.webkit.org/show_bug.cgi?id=143687

Reviewed by Tim Horton.

* Platform/SharedMemory.h:
* Platform/mac/SharedMemoryMac.cpp:
(WebKit::machProtection):
(WebKit::SharedMemory::create):
(WebKit::SharedMemory::map):
(WebKit::SharedMemory::createHandle):

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

5 years agoRegression: Scrolling on popsci.com spends too much time in FrameView::viewportsConte...
cdumez@apple.com [Tue, 14 Apr 2015 00:45:47 +0000 (00:45 +0000)]
Regression: Scrolling on popsci.com spends too much time in FrameView::viewportsContentsChanged()
https://bugs.webkit.org/show_bug.cgi?id=143675

Reviewed by Simon Fraser.

Optimize resumeVisibleImageAnimationsIncludingSubframes() so that the FrameViews'
windowClipRect gets computed less often:
- Cache the FrameView's windowClipRect before resuming image animations in subframes
  as calling windowClipRect() on those subframes' view is going to call windowClipRect()
  on their ancestors. This avoids a lot of unnecessary windowClipRect recomputations
  in deep frame trees.
- Stop traversing the Frame tree if the current frame does not have a content
  renderer, as this means the subframes won't have one either.
- Stop traversing the Frame tree if the current frame's view has an empty
  windowClipRect() as this means the windowClipRect will be empty for those
  subframes as well.

On popsci.com, this cuts down the number of uncached windowClipRect() calls by
approximately half. I see viewportsContentsChanged() at ~0.4% when scrolling
on popsci.com after this change.

* page/FrameView.cpp:
(WebCore::FrameView::resumeVisibleImageAnimationsIncludingSubframes):
(WebCore::FrameView::windowClipRect):
* page/FrameView.h:
* rendering/RenderView.cpp:
(WebCore::RenderView::resumePausedImageAnimationsIfNeeded):
* rendering/RenderView.h:

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

5 years agoAdd a persistent, fixed scale factor to make it easy to scale down WK(Web)Views
timothy_horton@apple.com [Tue, 14 Apr 2015 00:27:39 +0000 (00:27 +0000)]
Add a persistent, fixed scale factor to make it easy to scale down WK(Web)Views
https://bugs.webkit.org/show_bug.cgi?id=143560
<rdar://problem/16302047>

Reviewed by Darin Adler.

Add a new "view" scale factor to WKView and WKWebView.

Unlike page scale (or "magnification" in the API), view scale:
    - persists between page loads
    - persists between Web process crashes
    - is not user adjustable
    - can reliably be < 1

The page scale and view scale are multiplied together whenever we push
a new page scale down into WebCore, so the implementation of view scale
is transparent to WebCore, and acts effectively as a constant multiplier
for the (user-adjustable) page scale factor.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::scaleView):
Add scaleView, which updates our cached viewScaleFactor and pushes it to the Web process.

(WebKit::WebPageProxy::creationParameters):
Plumb viewScaleFactor through the page creation parameters.

* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::viewScaleFactor): Added.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
If the viewScaleFactor is not 1 at creation time, call scalePage with a page scale of 1.
Internally, scalePage will multiply in the viewScaleFactor and push it all to the Web process.

(WebKit::WebPage::scalePage):
Multiply the page scale factor by the view scale factor before passing it to WebCore.

(WebKit::WebPage::scalePageInViewCoordinates):
Early returns need to check the total scale, not just the new page scale.

(WebKit::WebPage::totalScaleFactor):
The scale that we get back from WebCore::Page::pageScaleFactor is the product
of WebKit2's view and page scales. So, here we'll call that the totalScaleFactor.
(Might need a different name because it seems like "total" should include deviceScale too).

(WebKit::WebPage::pageScaleFactor):
WebKit2's notion of the pageScaleFactor does not include the view scale, so
divide it out of WebCore's page scale.

(WebKit::WebPage::scaleView):
Apply a new view scale, maintaining the current scroll position.

* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::viewScaleFactor):
* WebProcess/WebPage/WebPage.messages.in:

* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
Plumb viewScaleFactor through the page creation parameters.

* UIProcess/API/Cocoa/WKViewPrivate.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _viewScale]):
(-[WKWebView _setViewScale:]):
* UIProcess/API/mac/WKView.mm:
(-[WKView _viewScale]):
(-[WKView _setViewScale:]):
Push the new view scale to WebPage.

* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _setAutomaticallyComputesFixedLayoutSizeFromViewScale:]):
(-[WKWebView _automaticallyComputesFixedLayoutSizeFromViewScale]):
* UIProcess/API/mac/WKView.mm:
(-[WKView setFrameSize:]):
(-[WKView _updateAutomaticallyComputedFixedLayoutSize]):
(-[WKView _setAutomaticallyComputesFixedLayoutSizeFromViewScale:]):
(-[WKView _automaticallyComputesFixedLayoutSizeFromViewScale]):
* UIProcess/API/mac/WKViewInternal.h:
Add a new layout mode, "DynamicSizeComputedFromViewScale",
which turns on fixed layout size mode, and sets the fixed layout size
based on the view's frame and view scale. The fixed layout size is maintained
as the frame of the view scaled by the inverse of the view scale. This
makes it very easy to maintain a WK(Web)View that is scaled down by
a constant amount, but is laid out as if it were not.

* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::adjustTransientZoom):
(WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom):
(WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToPage):
Because the transient zoom mechanism touches layers that WebCore owns,
it mostly need to operate with totalScaleFactor, because that is what WebCore sees.

* MiniBrowser/mac/BrowserWindowController.h:
* MiniBrowser/mac/MainMenu.xib:
* MiniBrowser/mac/WK1BrowserWindowController.m:
(-[WK1BrowserWindowController setScale:]):
* MiniBrowser/mac/WK2BrowserWindowController.m:
(viewScaleForMenuItemTag):
(-[WK2BrowserWindowController setScale:]):
(-[WK2BrowserWindowController validateMenuItem:]):
Add a submenu with four view scale options: 100%, 75%, 50%, and 25%.
When in use, we resize the window so that the view fits correctly, and
use automaticallyComputesFixedlayoutSizeFromViewScale so that the page's
layout size will not change when scaling down (but will update appropriately
when the view is resized).

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

5 years agoUnreviewed. Set the title text of the placard added in r182631.
roger_fong@apple.com [Tue, 14 Apr 2015 00:11:58 +0000 (00:11 +0000)]
Unreviewed. Set the title text of the placard added in r182631.
https://bugs.webkit.org/show_bug.cgi?id=143585.
<rdar://problem/12067439>

* Modules/mediacontrols/mediaControlsApple.js:
(Controller.prototype.updateWirelessPlaybackStatus):

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

5 years agobuild.webkit.org/dashboard shows obsolete results when builds are substantially out...
ap@apple.com [Tue, 14 Apr 2015 00:08:29 +0000 (00:08 +0000)]
build.webkit.org/dashboard shows obsolete results when builds are substantially out of order
https://bugs.webkit.org/show_bug.cgi?id=138630

Reviewed by Tim Horton.

Make sure that we always load at least one in order productive iteration.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotQueue.js:
(BuildbotQueue): Added _hasLoadedIterationForInOrderResult to track whether the queue
is done loading at least one iteration that wasn't an out of order build.
(BuildbotQueue.prototype.loadMoreHistoricalIterations): Listen for iteration load
when that's needed to check for out of order builds.
(BuildbotQueue.prototype.update): Ditto.
(BuildbotQueue.prototype._checkForInOrderResult): Check if the queue has an in order
result, and if it does not, load more iterations.
(BuildbotQueue.prototype.loadAll): We have everything loaded, so we certainly have
an in order iteration loaded too.
(BuildbotQueue.prototype.compareIterations): Extracted from sortIterations(), and
corrected to always sort loaded iterations before unloaded ones.

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

5 years agoimported/w3c/canvas/2d.text.measure.width.empty.html is flaky
ap@apple.com [Tue, 14 Apr 2015 00:07:35 +0000 (00:07 +0000)]
imported/w3c/canvas/2d.text.measure.width.empty.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=143671

Reviewed by Tim Horton.

* canvas/2d.text.measure.width.empty.html:
* canvas/2d.text.measure.width.empty-expected.txt:
Updated the test to trunk, where it uses testharness, which knows about waitUntilDone.

* fonts: Added.
* fonts/CanvasTest.ttf: Added.
While at it, added a font that this test includes (probably for no good reason).
This avoids hitting a sandbox violation.

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

5 years agoExpand test infrastructure to support scrolling tests
bfulgham@apple.com [Tue, 14 Apr 2015 00:05:17 +0000 (00:05 +0000)]
Expand test infrastructure to support scrolling tests
https://bugs.webkit.org/show_bug.cgi?id=143286
<rdar://problem/20375516>

Reviewed by Simon Fraser.

Source/WebCore:

No new functionality.

This series of changes adds a new singleton class, 'WheelEventTestTrigger', which encapsulates a
function object to be fired when scroll events are finished. The object also keeps track of reasons
why the test should not yet fire (e.g., 'rubberbanding' is active) so that tests do not incorrectly
check rendering state in the middle of an animation.

This code is not yet hooked up to the rendering system, and so does not have any effect on behavior.

* CMakeLists.txt: Add new WheelEventTestTrigger files.
* WebCore.vcxproj/WebCore.vcxproj: Ditto.
* WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* page/MainFrame.cpp:
(WebCore::MainFrame::MainFrame): Add new member to constructor.
(WebCore::MainFrame::testTrigger): Added.
(WebCore::MainFrame::ensureTestTrigger): Added.
(WebCore::MainFrame::clearTrigger): Added.
* page/MainFrame.h:
* page/WheelEventTestTrigger.cpp: Added.
(WebCore::WheelEventTestTrigger::WheelEventTestTrigger):
(WebCore::WheelEventTestTrigger::createWeakPtr):
(WebCore::WheelEventTestTrigger::clearAllTestDeferrals):
(WebCore::WheelEventTestTrigger::setTestNotificationCallback):
(WebCore::WheelEventTestTrigger::deferTestsForReason):
(WebCore::WheelEventTestTrigger::removeTestDeferralForReason):
(WebCore::WheelEventTestTrigger::triggerTestTimerFired):
* page/WheelEventTestTrigger.h: Added.

Source/WebKit2:

Extend the WK2 testing API to include a method for setting a JSC callback function to be triggered
by the new WebCore::WheelEventTestTrigger singleton.

* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageStartMonitoringScrollOperations): WK2 method that causes the testing system to begin tracking wheel events.
(WKBundlePageRegisterScrollOperationCompletionCallback): WK2 method to set the callback function for testing.
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:

Tools:

Extend the WK1 and WK2 test programs to support two new EventSender commands:
(1) monitorWheelEvents: Tells DRT and WKTR to track the wheel event and animation state, so that we can
block executing tests until WebKit has completed any rubberband, scroll, or scroll-snap animations.
(2) callAfterScrollingCompletes: Provide a callback method to be executed when WebKit determines that
relevant rubberband, scroll, and scroll-snap animations are finished.

* DumpRenderTree/mac/EventSendingController.mm:
(+[EventSendingController isSelectorExcludedFromWebScript:]): Update to recognize 'callAfterScrollingCompletes:'
and 'monitorWheelEvents'.
(+[EventSendingController webScriptNameForSelector:]): Ditto.
(-[EventSendingController mouseScrollByX:andY:continuously:]): Add some stderr logging to help when
debugging test failures.
(-[EventSendingController mouseScrollByX:andY:withWheel:andMomentumPhases:]): Ditto.
(-[EventSendingController callAfterScrollingCompletes:]): Added. Protects the JSObject representing the callback
function, then passes it to WebCore to be called once the test deferrals have been cleared.
(-[EventSendingController monitorWheelEvents:]): Added. Activates the wheel event tracking used by the
'callAfterScrollingCompletes' method.
* WebKitTestRunner/InjectedBundle/Bindings/EventSendingController.idl: Added signatures for 'callAfterScrollingCompletes'
and 'monitorWheelEvents'.
* WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
(WTR::EventSendingController::callAfterScrollingCompletes): Added. Protects the JSObject representing the
callback function, then passes it to WebCore to be called once the test deferrals have been cleared
(WTR::EventSendingController::monitorWheelEvents): Added. Activates the wheel event tracking used by the
'callAfterScrollingComplates' method.
* WebKitTestRunner/InjectedBundle/EventSendingController.h:

LayoutTests:

Correct a scrolling test that had not been issuing wheel events to a valid
view. This was found by some new logging in this patch.

* platform/mac/fast/scrolling/scroll-div-latched-div-expected.txt:
* platform/mac/fast/scrolling/scroll-div-latched-div.html:
* platform/mac-wk1/scrollbars/scrollevent-iframe-no-scrolling-wheel-expected.txt: Added.*

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

5 years agoFix LayoutTests/http/tests/canvas/canvas-tainted-after-draw-image.html on all bots
said@apple.com [Mon, 13 Apr 2015 23:51:36 +0000 (23:51 +0000)]
Fix LayoutTests/http/tests/canvas/canvas-tainted-after-draw-image.html on all bots
following http://trac.webkit.org/changeset/182750.

Reviewed by Daniel Bates.

* http/tests/canvas/canvas-tainted-after-draw-image-expected.txt:
* http/tests/canvas/canvas-tainted-after-draw-image.html:
Set window.jsTestIsAsync true and call finishJSTest() to make the test
asynchronous, so the "TEST COMPLETE" message will be output after all the
test messages. Also delete the synchronous tests for data url image and
same-domain image since they can't be reliably tested.

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

5 years ago[iOS] When entering optimized fullscreen, standard fullscreen view should exit.
jer.noble@apple.com [Mon, 13 Apr 2015 23:41:17 +0000 (23:41 +0000)]
[iOS] When entering optimized fullscreen, standard fullscreen view should exit.
https://bugs.webkit.org/show_bug.cgi?id=143615

Reviewed by Simon Fraser.

When entering optimized fullscreen from standard fullscreen, the original fullscreen
view should animate out.

The original method for entering optimized fullscreen is deprecated, so replace it with
the new method (which doesn't take completion blocks) and use delegate methods to detect
when the animation transition completes.

* platform/Logging.h:
* platform/ios/WebVideoFullscreenInterfaceAVKit.h:
* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(boolString): Added; use for logging boolean parameters.
(-[WebAVPlayerController playerViewControllerWillStartOptimizedFullscreen:]): Pass to WebVideoFullscreenInterfaceAVKit.
(-[WebAVPlayerController playerViewControllerDidStartOptimizedFullscreen:]): Ditto.
(-[WebAVPlayerController playerViewControllerWillStopOptimizedFullscreen:]): Ditto.
(-[WebAVPlayerController playerViewControllerDidStopOptimizedFullscreen:]): Ditto.
(-[WebAVPlayerController playerViewControllerWillCancelOptimizedFullscreen:]): Ditto.
(-[WebAVPlayerController playerViewControllerDidCancelOptimizedFullscreen:]): Ditto.
(-[WebAVPlayerController playerViewController:restoreUserInterfaceForOptimizedFullscreenStopWithCompletionHandler:]): Ditto.
(-[WebAVVideoLayer setPlayerViewController:]): Remove the KVO registration; now handled by above delegate methods.
(WebVideoFullscreenInterfaceAVKit::setupFullscreenInternal): Add logging.
(WebVideoFullscreenInterfaceAVKit::enterFullscreen): Ditto.
(WebVideoFullscreenInterfaceAVKit::enterFullscreenOptimized): Use new -startOptimizedFullscreen method.
(WebVideoFullscreenInterfaceAVKit::enterFullscreenStandard): Add logging.
(WebVideoFullscreenInterfaceAVKit::exitFullscreenInternal): Ditto.
(WebVideoFullscreenInterfaceAVKit::cleanupFullscreenInternal): Use hasMode() & isMode() rather than checking m_mode directly.
(WebVideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen): Ditto.
(WebVideoFullscreenInterfaceAVKit::preparedToReturnToInline): Callback now stored on this object rather than the WebAVPlayerController.
(WebVideoFullscreenInterfaceAVKit::mayAutomaticallyShowVideoOptimized): Moved.
(WebVideoFullscreenInterfaceAVKit::fullscreenMayReturnToInline): Added; store the passed callback.
(WebVideoFullscreenInterfaceAVKit::willStartOptimizedFullscreen): Exit out of standard fullscreen mode if necessary.
(WebVideoFullscreenInterfaceAVKit::didStartOptimizedFullscreen): Moved from the start lambda in enterFullscreenOptimized().
(WebVideoFullscreenInterfaceAVKit::willStopOptimizedFullscreen): Call the model's requestExitFullscreen() method.
(WebVideoFullscreenInterfaceAVKit::didStopOptimizedFullscreen): Moved from the stop lambda in enterFullscreenOptimized().
(WebVideoFullscreenInterfaceAVKit::willCancelOptimizedFullscreen): Call the model's requestExitFullscreen() method.
(WebVideoFullscreenInterfaceAVKit::didCancelOptimizedFullscreen): Moved from the stop lambda in enterFullscreenOptimized().
(WebVideoFullscreenInterfaceAVKit::prepareForOptimizedFullscreenStopWithCompletionHandler): Moved from -playerViewController:shouldExitFullScreenWithReason:.
(WebVideoFullscreenInterfaceAVKit::setMode): Added; Call fullscreenModeChanged() if necessary.
(WebVideoFullscreenInterfaceAVKit::clearMode): Ditto.
(-[WebAVVideoLayer observeValueForKeyPath:ofObject:change:context:]): Deleted.
(WebVideoFullscreenInterfaceAVKit::setIsOptimized): Deleted.

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

5 years agoClients of WKWebView should be able to override drag functions.
enrica@apple.com [Mon, 13 Apr 2015 23:23:28 +0000 (23:23 +0000)]
Clients of WKWebView should be able to override drag functions.
https://bugs.webkit.org/show_bug.cgi?id=143618

Reviewed by Darin Adler.

WKWebView now implements the drag protocol functions and
forwards the calls to the inner WKView.
In the page client, when we receive a request to start drag
from the WebProcess, we call _dragImageForView in WKView with
the target view. The function calls dragImage on the given view,
so that its clients can override the dragImage function.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView draggingEntered:]):
(-[WKWebView draggingUpdated:]):
(-[WKWebView draggingExited:]):
(-[WKWebView prepareForDragOperation:]):
(-[WKWebView performDragOperation:]):
* UIProcess/API/mac/WKView.mm:
(-[WKView _dragImageForView:withImage:at:linkDrag:]):
(-[WKView _setDragImage:at:linkDrag:]): Deleted.
* UIProcess/API/mac/WKViewInternal.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::setDragImage):

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

5 years ago[iOS] Unreviewed build fix after r182760.
achristensen@apple.com [Mon, 13 Apr 2015 23:20:18 +0000 (23:20 +0000)]
[iOS] Unreviewed build fix after r182760.

* Shared/WebCoreArgumentCoders.cpp:
(IPC::encodeSharedBuffer):
(IPC::decodeSharedBuffer):
Update SharedMemory function names.

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

5 years agoUnreviewed, fix Windows build. Windows doesn't take kindly to private classes that...
fpizlo@apple.com [Mon, 13 Apr 2015 22:57:18 +0000 (22:57 +0000)]
Unreviewed, fix Windows build. Windows doesn't take kindly to private classes that use FAST_ALLOCATED.

* runtime/InferredValue.h:

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

5 years agoUnreviewed, fix build. I introduced a new cell type at the same time as kling changed...
fpizlo@apple.com [Mon, 13 Apr 2015 22:33:44 +0000 (22:33 +0000)]
Unreviewed, fix build. I introduced a new cell type at the same time as kling changed how new cell types are written.

* runtime/InferredValue.h:

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

5 years agoFix compositing/geometry/fixed-transformed.html on Mavericks.
simon.fraser@apple.com [Mon, 13 Apr 2015 22:31:55 +0000 (22:31 +0000)]
Fix compositing/geometry/fixed-transformed.html on Mavericks.

To get consistent results on Mavericks, call
internals.settings.setAcceleratedCompositingForFixedPositionEnabled(true);

* compositing/geometry/fixed-transformed.html:

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

5 years agoRename SharedMemory::create overloads
andersca@apple.com [Mon, 13 Apr 2015 22:26:34 +0000 (22:26 +0000)]
Rename SharedMemory::create overloads
https://bugs.webkit.org/show_bug.cgi?id=143679

Reviewed by Beth Dakin.

Rename the SharedMemory::create overload that allocates memory to SharedMemory::allocate,
and the SharedMemory::create overload that maps in a handle to SharedMemory::map.

* Platform/SharedMemory.h:
* Platform/mac/SharedMemoryMac.cpp:
(WebKit::SharedMemory::allocate):
(WebKit::SharedMemory::map):
(WebKit::SharedMemory::create): Deleted.
* Shared/ShareableBitmap.cpp:
(WebKit::ShareableBitmap::createShareable):
(WebKit::ShareableBitmap::create):
* Shared/ShareableResource.cpp:
(WebKit::ShareableResource::create):
* Shared/ShareableResource.h:
* Shared/WebCompiledContentExtension.cpp:
(WebKit::WebCompiledContentExtension::createFromCompiledContentExtensionData):
* Shared/WebCompiledContentExtensionData.cpp:
(WebKit::WebCompiledContentExtensionData::decode):
* Shared/WebHitTestResult.cpp:
(WebKit::WebHitTestResult::Data::Data):
(WebKit::WebHitTestResult::Data::decode):
* UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
(WebKit::WebPasteboardProxy::getPasteboardBufferForType):
(WebKit::WebPasteboardProxy::setPasteboardBufferForType):
* UIProcess/VisitedLinkProvider.cpp:
(WebKit::VisitedLinkProvider::resizeTable):
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::dataSelectionForPasteboard):
(WebKit::WebPageProxy::setPromisedDataForImage):
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::writeItemsToPasteboard):
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::bufferForType):
(WebKit::WebPlatformStrategies::setBufferForType):
* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
(WebKit::WebDragClient::declareAndWriteDragImage):
* WebProcess/WebPage/VisitedLinkTableController.cpp:
(WebKit::VisitedLinkTableController::setVisitedLinkTable):
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::getDataSelectionForPasteboard):

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

5 years agoJSC should detect singleton functions
fpizlo@apple.com [Mon, 13 Apr 2015 22:13:12 +0000 (22:13 +0000)]
JSC should detect singleton functions
https://bugs.webkit.org/show_bug.cgi?id=143232

Source/JavaScriptCore:

Reviewed by Geoffrey Garen.

This started out as an attempt to make constructors faster by detecting when a constructor is a
singleton. The idea is that each FunctionExecutable has a VariableWatchpointSet - a watchpoint
along with an inferred value - that detects if only one JSFunction has been allocated for that
executable, and if so, what that JSFunction is. Then, inside the code for the FunctionExecutable,
if the watchpoint set has an inferred value (i.e. it's been initialized and it is still valid),
we can constant-fold GetCallee.

Unfortunately, constructors don't use GetCallee anymore, so that didn't pan out. But in the
process I realized a bunch of things:

- This allows us to completely eliminate the GetCallee/GetScope sequence that we still sometimes
  had even in code where our singleton-closure detection worked. That's because singleton-closure
  inference worked at the op_resolve_scope, and that op_resolve_scope still needed to keep alive
  the incoming scope in case we OSR exit. But by constant-folding GetCallee, that sequence
  disappears. OSR exit can rematerialize the callee or the scope by just knowing their constant
  values.

- Singleton detection should be a reusable thing. So, I got rid of VariableWatchpointSet and
  created InferredValue. InferredValue is a cell, so it can handle its own GC magic.
  FunctionExecutable uses an InferredValue to tell you about singleton JSFunctions.

- The old singleton-scope detection in op_resolve_scope is better abstracted as a SymbolTable
  detecting a singleton JSSymbolTableObject. So, SymbolTable uses an InferredValue to tell you
  about singleton JSSymbolTableObjects. It's curious that we want to have singleton detection in
  SymbolTable if we already have it in FunctionExecutable. This comes into play in two ways.
  First, it means that the DFG can realize sooner that a resolve_scope resolves to a constant
  scope. Ths saves compile times and it allows prediction propagation to benefit from the
  constant folding. Second, it means that we will detect a singleton scope even if it is
  referenced from a non-singleton scope that is nearer to us in the scope chain. This refactoring
  allows us to eliminate the function reentry watchpoint.

- This allows us to use a normal WatchpointSet, instead of a VariableWatchpointSet, for inferring
  constant values in scopes. Previously when the DFG inferred that a closure variable was
  constant, it wouldn't know which closure that variable was in and so it couldn't just load that
  value. But now we are first inferring that the function is a singleton, which means that we
  know exactly what scope it points to, and we can load the value from the scope. Using a
  WatchpointSet instead of a VariableWatchpointSet saves some memory and simplifies a bunch of
  code. This also means that now, the only user of VariableWatchpointSet is FunctionExecutable.
  I've tweaked the code of VariableWatchpointSet to reduce its power to just be what
  FunctionExecutable wants.

This also has the effect of simplifying the implementation of block scoping. Prior to this
change, block scoping would have needed to have some story for the function reentry watchpoint on
any nested symbol table. That's totally weird to think about; it's not really a function reentry
but a scope reentry. Now we don't have to think about this. Constant inference on nested scopes
will "just work": if we prove that we know the constant value of the scope then the machinery
kicks in, otherwise it doesn't.

This is a small Octane and AsmBench speed-up. AsmBench sees 1% while Octane sees sub-1%.

* CMakeLists.txt:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/BytecodeList.json:
* bytecode/BytecodeUseDef.h:
(JSC::computeUsesForBytecodeOffset):
(JSC::computeDefsForBytecodeOffset):
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::dumpBytecode):
(JSC::CodeBlock::CodeBlock):
(JSC::CodeBlock::finalizeUnconditionally):
(JSC::CodeBlock::valueProfileForBytecodeOffset):
* bytecode/CodeBlock.h:
(JSC::CodeBlock::valueProfileForBytecodeOffset): Deleted.
* bytecode/CodeOrigin.cpp:
(JSC::InlineCallFrame::calleeConstant):
(JSC::InlineCallFrame::visitAggregate):
* bytecode/CodeOrigin.h:
(JSC::InlineCallFrame::calleeConstant): Deleted.
(JSC::InlineCallFrame::visitAggregate): Deleted.
* bytecode/Instruction.h:
* bytecode/VariableWatchpointSet.cpp: Removed.
* bytecode/VariableWatchpointSet.h: Removed.
* bytecode/VariableWatchpointSetInlines.h: Removed.
* bytecode/VariableWriteFireDetail.cpp: Added.
(JSC::VariableWriteFireDetail::dump):
(JSC::VariableWriteFireDetail::touch):
* bytecode/VariableWriteFireDetail.h: Added.
(JSC::VariableWriteFireDetail::VariableWriteFireDetail):
* bytecode/Watchpoint.h:
(JSC::WatchpointSet::stateOnJSThread):
(JSC::WatchpointSet::startWatching):
(JSC::WatchpointSet::fireAll):
(JSC::WatchpointSet::touch):
(JSC::WatchpointSet::invalidate):
(JSC::InlineWatchpointSet::stateOnJSThread):
(JSC::InlineWatchpointSet::state):
(JSC::InlineWatchpointSet::hasBeenInvalidated):
(JSC::InlineWatchpointSet::invalidate):
(JSC::InlineWatchpointSet::touch):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::BytecodeGenerator):
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::get):
(JSC::DFG::ByteCodeParser::parseBlock):
(JSC::DFG::ByteCodeParser::getScope): Deleted.
* dfg/DFGCapabilities.cpp:
(JSC::DFG::capabilityLevel):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDesiredWatchpoints.cpp:
(JSC::DFG::InferredValueAdaptor::add):
(JSC::DFG::DesiredWatchpoints::addLazily):
(JSC::DFG::DesiredWatchpoints::reallyAdd):
(JSC::DFG::DesiredWatchpoints::areStillValid):
* dfg/DFGDesiredWatchpoints.h:
(JSC::DFG::InferredValueAdaptor::hasBeenInvalidated):
(JSC::DFG::DesiredWatchpoints::isWatched):
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::dump):
(JSC::DFG::Graph::tryGetConstantClosureVar):
* dfg/DFGNode.h:
(JSC::DFG::Node::hasWatchpointSet):
(JSC::DFG::Node::watchpointSet):
(JSC::DFG::Node::hasVariableWatchpointSet): Deleted.
(JSC::DFG::Node::variableWatchpointSet): Deleted.
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileNewFunction):
(JSC::DFG::SpeculativeJIT::compileCreateActivation):
(JSC::DFG::SpeculativeJIT::compileNotifyWrite):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::callOperation):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGVarargsForwardingPhase.cpp:
* ftl/FTLIntrinsicRepository.h:
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::compileCreateActivation):
(JSC::FTL::LowerDFGToLLVM::compileNewFunction):
(JSC::FTL::LowerDFGToLLVM::compileNotifyWrite):
* interpreter/Interpreter.cpp:
(JSC::StackFrame::friendlySourceURL):
(JSC::StackFrame::friendlyFunctionName):
* interpreter/Interpreter.h:
(JSC::StackFrame::friendlySourceURL): Deleted.
(JSC::StackFrame::friendlyFunctionName): Deleted.
* jit/JIT.cpp:
(JSC::JIT::emitNotifyWrite):
(JSC::JIT::privateCompileMainPass):
* jit/JIT.h:
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_touch_entry): Deleted.
* jit/JITOperations.cpp:
* jit/JITOperations.h:
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emitPutGlobalVar):
(JSC::JIT::emitPutClosureVar):
(JSC::JIT::emitNotifyWrite): Deleted.
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::emitPutGlobalVar):
(JSC::JIT::emitPutClosureVar):
(JSC::JIT::emitNotifyWrite): Deleted.
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL): Deleted.
* runtime/CommonSlowPaths.h:
* runtime/Executable.cpp:
(JSC::FunctionExecutable::finishCreation):
(JSC::FunctionExecutable::visitChildren):
* runtime/Executable.h:
(JSC::FunctionExecutable::singletonFunction):
* runtime/InferredValue.cpp: Added.
(JSC::InferredValue::create):
(JSC::InferredValue::destroy):
(JSC::InferredValue::createStructure):
(JSC::InferredValue::visitChildren):
(JSC::InferredValue::InferredValue):
(JSC::InferredValue::~InferredValue):
(JSC::InferredValue::notifyWriteSlow):
(JSC::InferredValue::ValueCleanup::ValueCleanup):
(JSC::InferredValue::ValueCleanup::~ValueCleanup):
(JSC::InferredValue::ValueCleanup::finalizeUnconditionally):
* runtime/InferredValue.h: Added.
(JSC::InferredValue::inferredValue):
(JSC::InferredValue::state):
(JSC::InferredValue::isStillValid):
(JSC::InferredValue::hasBeenInvalidated):
(JSC::InferredValue::add):
(JSC::InferredValue::notifyWrite):
(JSC::InferredValue::invalidate):
* runtime/JSEnvironmentRecord.cpp:
(JSC::JSEnvironmentRecord::visitChildren):
* runtime/JSEnvironmentRecord.h:
(JSC::JSEnvironmentRecord::isValid):
(JSC::JSEnvironmentRecord::finishCreation):
* runtime/JSFunction.cpp:
(JSC::JSFunction::create):
* runtime/JSFunction.h:
(JSC::JSFunction::createWithInvalidatedReallocationWatchpoint):
(JSC::JSFunction::createImpl):
(JSC::JSFunction::create): Deleted.
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::addGlobalVar):
(JSC::JSGlobalObject::addFunction):
* runtime/JSGlobalObject.h:
* runtime/JSLexicalEnvironment.cpp:
(JSC::JSLexicalEnvironment::symbolTablePut):
* runtime/JSScope.h:
(JSC::ResolveOp::ResolveOp):
* runtime/JSSegmentedVariableObject.h:
(JSC::JSSegmentedVariableObject::finishCreation):
* runtime/JSSymbolTableObject.h:
(JSC::JSSymbolTableObject::JSSymbolTableObject):
(JSC::JSSymbolTableObject::setSymbolTable):
(JSC::symbolTablePut):
(JSC::symbolTablePutWithAttributes):
* runtime/PutPropertySlot.h:
* runtime/SymbolTable.cpp:
(JSC::SymbolTableEntry::prepareToWatch):
(JSC::SymbolTable::SymbolTable):
(JSC::SymbolTable::finishCreation):
(JSC::SymbolTable::visitChildren):
(JSC::SymbolTableEntry::inferredValue): Deleted.
(JSC::SymbolTableEntry::notifyWriteSlow): Deleted.
(JSC::SymbolTable::WatchpointCleanup::WatchpointCleanup): Deleted.
(JSC::SymbolTable::WatchpointCleanup::~WatchpointCleanup): Deleted.
(JSC::SymbolTable::WatchpointCleanup::finalizeUnconditionally): Deleted.
* runtime/SymbolTable.h:
(JSC::SymbolTableEntry::disableWatching):
(JSC::SymbolTableEntry::watchpointSet):
(JSC::SymbolTable::singletonScope):
(JSC::SymbolTableEntry::notifyWrite): Deleted.
* runtime/TypeProfiler.cpp:
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:
* tests/stress/infer-uninitialized-closure-var.js: Added.
(foo.f):
(foo):
* tests/stress/singleton-scope-then-overwrite.js: Added.
(foo.f):
(foo):
* tests/stress/singleton-scope-then-realloc-and-overwrite.js: Added.
(foo):
* tests/stress/singleton-scope-then-realloc.js: Added.
(foo):

LayoutTests:

Reviewed by Geoffrey Garen and Michael Saboff.

* js/regress/create-lots-of-functions-expected.txt: Added.
* js/regress/create-lots-of-functions.html: Added.
* js/regress/no-inline-constructor-expected.txt: Added.
* js/regress/no-inline-constructor.html: Added.
* js/regress/script-tests/create-lots-of-functions.js: Added.
* js/regress/script-tests/no-inline-constructor.js: Added.
* js/regress/script-tests/singleton-scope.js: Added.
* js/regress/singleton-scope-expected.txt: Added.
* js/regress/singleton-scope.html: Added.

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

5 years ago[Win] Unreviewed fix after r182757.
bfulgham@apple.com [Mon, 13 Apr 2015 21:42:16 +0000 (21:42 +0000)]
[Win] Unreviewed fix after r182757.

* platform/win/FileSystemWin.cpp:
(WebCore::renameFile): Checked in wrong version.

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

5 years ago[Win] Unreviewed fix after r182161.
bfulgham@apple.com [Mon, 13 Apr 2015 21:37:42 +0000 (21:37 +0000)]
[Win] Unreviewed fix after r182161.

The change caused Windows to lose Media UI, since the new 'getFileSize'
signature was being improperly used for a 'UInt8'-based string.

Fix was to provide implementations for the two new methods, and to make
sure RenderThemeWin was using the proper signature.

This should actually be a little more efficient, since we have the file
handle when we call this new method. Previously, a Windows 'find file' was
being done with the requested path, which was unnecessary work.

* platform/win/FileSystemWin.cpp:
(WebCore::getFileSizeFromByHandleFileInformationStructure): Added helper function.
(WebCore::getFileSize): Provide implementation.
(WebCore::renameFile):
* rendering/RenderThemeWin.cpp:
(WebCore::RenderThemeWin::stringWithContentsOfFile): Use the file handle to
get the file size, rather than using the path-based size lookup (which involves
performing an unnecessary file search.

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

5 years agoShare sheets from Share menus appear outside the browser window.
beidson@apple.com [Mon, 13 Apr 2015 21:23:09 +0000 (21:23 +0000)]
Share sheets from Share menus appear outside the browser window.
<rdar://problem/20455592> and https://bugs.webkit.org/show_bug.cgi?id=143620

Reviewed by Darin Adler.

Source/WebCore:

* page/ContextMenuController.h:
(WebCore::ContextMenuController::client):

Source/WebKit/mac:

Refactor existing Sharing Service Picker code to also be used for the Share menu NSMenuItem.

* Misc/WebSharingServicePickerController.h:
(WebSharingServicePickerClient::webView):
* Misc/WebSharingServicePickerController.mm:
(WebSharingServicePickerClient::WebSharingServicePickerClient):
(WebSharingServicePickerClient::sharingServicePickerWillBeDestroyed):
(WebSharingServicePickerClient::pageForSharingServicePicker):
(WebSharingServicePickerClient::windowForSharingServicePicker):
(WebSharingServicePickerClient::screenRectForCurrentSharingServicePickerItem):
(WebSharingServicePickerClient::imageForCurrentSharingServicePickerItem):
(-[WebSharingServicePickerController initWithItems:includeEditorServices:client:style:]):
(-[WebSharingServicePickerController initWithSharingServicePicker:client:]):
(-[WebSharingServicePickerController sharingService:didShareItems:]):

* WebCoreSupport/WebContextMenuClient.h:
(WebContextMenuClient::webView): Deleted.
* WebCoreSupport/WebContextMenuClient.mm:
(WebContextMenuClient::WebContextMenuClient):
(WebContextMenuClient::pageForSharingServicePicker): Deleted.
(WebContextMenuClient::windowForSharingServicePicker): Deleted.

* WebCoreSupport/WebSelectionServiceController.h:
* WebCoreSupport/WebSelectionServiceController.mm:
(WebSelectionServiceController::WebSelectionServiceController):
(WebSelectionServiceController::handleSelectionServiceClick):
(WebSelectionServiceController::pageForSharingServicePicker): Deleted.
(WebSelectionServiceController::windowForSharingServicePicker): Deleted.
(WebSelectionServiceController::screenRectForCurrentSharingServicePickerItem): Deleted.
(WebSelectionServiceController::imageForCurrentSharingServicePickerItem): Deleted.

* WebView/WebHTMLView.mm:
(-[WebHTMLView menuForEvent:]):
* WebView/WebViewData.h:

Source/WebKit2:

Refactor existing Sharing Service Picker code to also be used for the Share menu NSMenuItem.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::internalShowContextMenu):
(WebKit::WebPageProxy::platformInitializeShareMenuItem):
* UIProcess/WebPageProxy.h:

* UIProcess/mac/WKSharingServicePickerDelegate.h: Added.
* UIProcess/mac/WKSharingServicePickerDelegate.mm: Added.
(+[WKSharingServicePickerDelegate sharedSharingServicePickerDelegate]):
(-[WKSharingServicePickerDelegate menuProxy]):
(-[WKSharingServicePickerDelegate setMenuProxy:]):
(-[WKSharingServicePickerDelegate setPicker:]):
(-[WKSharingServicePickerDelegate setFiltersEditingServices:]):
(-[WKSharingServicePickerDelegate setHandlesEditingReplacement:]):
(-[WKSharingServicePickerDelegate sharingServicePicker:sharingServicesForItems:mask:proposedSharingServices:]):
(-[WKSharingServicePickerDelegate sharingServicePicker:delegateForSharingService:]):
(-[WKSharingServicePickerDelegate sharingService:willShareItems:]):
(-[WKSharingServicePickerDelegate sharingService:didShareItems:]):
(-[WKSharingServicePickerDelegate sharingService:sourceWindowForShareItems:sharingContentScope:]):

* UIProcess/mac/WebContextMenuProxyMac.mm:
(WebKit::WebContextMenuProxyMac::setupServicesMenu):
(+[WKSharingServicePickerDelegate sharedSharingServicePickerDelegate]): Deleted.
(-[WKSharingServicePickerDelegate menuProxy]): Deleted.
(-[WKSharingServicePickerDelegate setMenuProxy:]): Deleted.
(-[WKSharingServicePickerDelegate setPicker:]): Deleted.
(-[WKSharingServicePickerDelegate setIncludeEditorServices:]): Deleted.
(-[WKSharingServicePickerDelegate sharingServicePicker:sharingServicesForItems:mask:proposedSharingServices:]): Deleted.
(-[WKSharingServicePickerDelegate sharingServicePicker:delegateForSharingService:]): Deleted.
(-[WKSharingServicePickerDelegate sharingService:willShareItems:]): Deleted.
(-[WKSharingServicePickerDelegate sharingService:didShareItems:]): Deleted.
(-[WKSharingServicePickerDelegate sharingService:sourceWindowForShareItems:sharingContentScope:]): Deleted.

* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::platformInitializeShareMenuItem):

* WebKit2.xcodeproj/project.pbxproj:

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

5 years agoAdd missing layout test result.
simon.fraser@apple.com [Mon, 13 Apr 2015 21:18:29 +0000 (21:18 +0000)]
Add missing layout test result.

* compositing/geometry/fixed-transformed-expected.txt: Added.

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

5 years agoRebaseline bindings tests.
akling@apple.com [Mon, 13 Apr 2015 20:53:32 +0000 (20:53 +0000)]
Rebaseline bindings tests.

* bindings/scripts/test/JS/JSTestActiveDOMObject.h:
* bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
* bindings/scripts/test/JS/JSTestEventTarget.h:
* bindings/scripts/test/JS/JSTestException.h:
* bindings/scripts/test/JS/JSTestInterface.h:
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/JS/JSTestTypedefs.h:

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

5 years agoBegin cleaning up the shared memory interface
andersca@apple.com [Mon, 13 Apr 2015 20:26:02 +0000 (20:26 +0000)]
Begin cleaning up the shared memory interface
https://bugs.webkit.org/show_bug.cgi?id=143677

Reviewed by Andreas Kling.

Rename createFromVMBuffer to create and add a protection parameter (which is currently unused).
Also, turn SharedMemory::Protection into a proper enum class.

* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::store):
* NetworkProcess/cache/NetworkCacheEntry.cpp:
(WebKit::NetworkCache::Entry::initializeBufferFromStorageRecord):
* NetworkProcess/mac/NetworkResourceLoaderMac.mm:
(WebKit::tryGetShareableHandleFromCFData):
* Platform/SharedMemory.h:
* Platform/mac/SharedMemoryMac.cpp:
(WebKit::SharedMemory::create):
(WebKit::machProtection):
(WebKit::SharedMemory::createHandle):
(WebKit::SharedMemory::createFromVMBuffer): Deleted.
* Shared/ContextMenuContextData.cpp:
(WebKit::ContextMenuContextData::encode):
(WebKit::ContextMenuContextData::decode):
* Shared/ShareableBitmap.h:
* Shared/ShareableResource.cpp:
(WebKit::ShareableResource::create):
(WebKit::ShareableResource::createHandle):
* Shared/WebCompiledContentExtensionData.cpp:
(WebKit::WebCompiledContentExtensionData::encode):
(WebKit::WebCompiledContentExtensionData::decode):
* Shared/WebHitTestResult.cpp:
(WebKit::WebHitTestResult::Data::encode):
(WebKit::WebHitTestResult::Data::decode):
* UIProcess/API/APIUserContentExtensionStore.cpp:
(API::createExtension):
* UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
(WebKit::WebPasteboardProxy::getPasteboardBufferForType):
(WebKit::WebPasteboardProxy::setPasteboardBufferForType):
(WebKit::WebPasteboardProxy::readBufferFromPasteboard):
* UIProcess/VisitedLinkProvider.cpp:
(WebKit::VisitedLinkProvider::sendTable):
* UIProcess/mac/WKPrintingView.mm:
(pageDidDrawToImage):
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::dataSelectionForPasteboard):
(WebKit::WebPageProxy::setPromisedDataForImage):
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::writeItemsToPasteboard):
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::bufferForType):
(WebKit::WebPlatformStrategies::setBufferForType):
(WebKit::WebPlatformStrategies::readBufferFromPasteboard):
* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
(WebKit::WebDragClient::declareAndWriteDragImage):
* WebProcess/WebPage/VisitedLinkTableController.cpp:
(WebKit::VisitedLinkTableController::setVisitedLinkTable):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::takeSnapshot):
(WebKit::WebPage::drawRectToImage):
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::getDataSelectionForPasteboard):

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

5 years ago[iOS] Treat a 'not found' media option index as the 'off' track.
jer.noble@apple.com [Mon, 13 Apr 2015 20:16:34 +0000 (20:16 +0000)]
[iOS] Treat a 'not found' media option index as the 'off' track.
https://bugs.webkit.org/show_bug.cgi?id=143672

Reviewed by Eric Carlson.

The UIProcess will pass in UINT64_MAX for the index of the legible option to select. Treat this
as if the captionOffMenuItem() had been selected to avoid a null dereference.

* platform/ios/WebVideoFullscreenModelVideoElement.mm:
(WebVideoFullscreenModelVideoElement::selectLegibleMediaOption):

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

5 years agolist-style-image with SVG image renders at incorrect size.
commit-queue@webkit.org [Mon, 13 Apr 2015 20:02:20 +0000 (20:02 +0000)]
list-style-image with SVG image renders at incorrect size.
https://bugs.webkit.org/show_bug.cgi?id=141367.

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2015-04-13
Reviewed by Darin Adler.
Source/WebCore:

This patch imports https://codereview.chromium.org/197203003.

When using an SVG as list marker image, don't unconditionally set the
dimensions to a square with the dimensions of ascent / 2, but rather
determine a suitable size using intrinsic dimensions (and ratio).

Test: svg/as-list-image/svg-list-image-intrinsic-size-1.html

* rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::updateContent):

LayoutTests:

Ensure the SVG image gets the correct size when used as an image list.

* svg/as-list-image: Added.
* svg/as-list-image/svg-list-image-intrinsic-size-1-expected.html: Added.
* svg/as-list-image/svg-list-image-intrinsic-size-1.html: Added.

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

5 years agoCanvas drawImage() has a security hole when the image isn't yet fully loaded.
said@apple.com [Mon, 13 Apr 2015 19:53:14 +0000 (19:53 +0000)]
Canvas drawImage() has a security hole when the image isn't yet fully loaded.
https://bugs.webkit.org/show_bug.cgi?id=58681.

Reviewed by Darin Adler.

Source/WebCore:

There is a race condition which may happen if an image from a different
origin is drawn on a canvas before it finishes loading. The check to taint
the canvas comes before drawing it. This check returns false if the image
is not completely loaded because we check the URL of the resource response.
If after this check and before the drawing, the image finishes loading, the
canvas will not be tainted but the image will be drawn.

The fix is to move the check to taint the canvas after drawing the image.
The only problem with this solution is basically the opposite of this bug:
we will become stricter than before with images which are from a different
origin and before they finish loading. The image has not finished loading,
so we do not draw it. Before we check for tainting, the image finishes
loading. So we decide to taint the canvas even the image is not drawn.

But this should not be a security issue anymore. I personally do not know
if it is even a correctness issue or not.

Test: http/tests/canvas/canvas-tainted-after-draw-image.html

* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::drawImage):

LayoutTests:

This test confirms when we load an image from a different origin and try
drawing it on a canvas, the canvas is tainted if the image is completely
loaded and drawn. Otherwise the image is not drawn.

* http/tests/canvas/canvas-tainted-after-draw-image-expected.txt: Added.
* http/tests/canvas/canvas-tainted-after-draw-image.html: Added.
* http/tests/canvas/resources: Added.
* http/tests/canvas/resources/100x100-lime-rect.svg: Added.

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

5 years agoCannot click "Next" button on Google two-factor auth setup page
jhoneycutt@apple.com [Mon, 13 Apr 2015 19:52:11 +0000 (19:52 +0000)]
Cannot click "Next" button on Google two-factor auth setup page

<https://bugs.webkit.org/show_bug.cgi?id=143624>
<rdar://problem/19175714>

.:

Reviewed by Darin Adler.

* ManualTests/button-that-focuses-itself-on-click.html: Added.

Source/WebKit2:

This issue occurs when this site focuses the submit button. When it
receives focus, we try to assist it. While we consider ourselves to be
assisting it, we ignore further gesture inputs for that node, including
the tap gesture.

To fix this, only assist input types that we know are assistable,
including text fields, select and date elements, etc.

Reviewed by Darin Adler.

* UIProcess/ios/WKContentViewInteraction.mm:
(isAssistableInputType):
If the type is a known-assistable type, return true.
(-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]):
Call isAssistableInputType() to determine whether we should do any kind
of assistance for this node.

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

5 years agoAdd force property to MouseEvents
bdakin@apple.com [Mon, 13 Apr 2015 19:17:48 +0000 (19:17 +0000)]
Add force property to MouseEvents
https://bugs.webkit.org/show_bug.cgi?id=143569
-and corresponding-
rdar://problem/20472954

Reviewed by Darin Adler.

Source/WebCore:

This patch removes WebKitMouseForceEvent and uses a MouseEvent everywhere that it
was used. That’s possible because this patch also adds a force property to all
MouseEvents and to PlatformMouseEvent.

Remove WebKitMouseForceEvent.
* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* dom/DOMAllInOne.cpp:

Create MouseEvents with the appropriate force instead of WebKitMouseForceEvents.
This patch also gets rid of the PlatformMouseEvent parameter for these events.
They were re-using the cached mousedown event before, which they never should have
done. Instead, we create PlatformMouseEvents inside these functions and then use
that to make MouseEvents.
* dom/Element.cpp:
(WebCore::Element::dispatchMouseForceWillBegin):
(WebCore::Element::dispatchMouseForceChanged):
(WebCore::Element::dispatchMouseForceDown):
(WebCore::Element::dispatchMouseForceUp):
(WebCore::Element::dispatchMouseForceClick):
(WebCore::Element::dispatchMouseForceCancelled):
* dom/Element.h:

No More WebKitMouseForceEvent.
* dom/EventNames.in:

Add force to MouseEvent.
* dom/MouseEvent.cpp:
(WebCore::MouseEvent::create):
(WebCore::MouseEvent::MouseEvent):
(WebCore::MouseEvent::cloneFor):
(WebCore::SimulatedMouseEvent::SimulatedMouseEvent):
* dom/MouseEvent.h:
(WebCore::MouseEvent::force):
(WebCore::MouseEvent::setForce):
* dom/MouseEvent.idl:

No More WebKitMouseForceEvent.
* dom/WebKitMouseForceEvent.cpp: Removed.
* dom/WebKitMouseForceEvent.h: Removed.
* dom/WebKitMouseForceEvent.idl: Removed.

PlatformMouseEvent now takes a force parameter.
* dom/WheelEvent.cpp:
(WebCore::WheelEvent::WheelEvent):
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::showContextMenuAt):
* page/DragController.cpp:
(WebCore::createMouseEvent):
* page/EventHandler.cpp:
(WebCore::EventHandler::dispatchDragEvent):
(WebCore::EventHandler::sendContextMenuEventForKey):
(WebCore::EventHandler::fakeMouseMoveEventTimerFired):

We don’t need lastMouseDownEvent() anymore. We were using it to avoid creating new
PlatformMouseEvents for the force events, but we fix that in this patch.
(WebCore::EventHandler::lastMouseDownEvent): Deleted.
* page/EventHandler.h:

At force to PlatformMouseEvent.
* platform/PlatformMouseEvent.h:
(WebCore::PlatformMouseEvent::PlatformMouseEvent):
(WebCore::PlatformMouseEvent::force):
* replay/SerializationMethods.cpp:
(JSC::EncodingTraits<PlatformMouseEvent>::encodeValue):
(JSC::EncodingTraits<PlatformMouseEvent>::decodeValue):

Source/WebKit/ios:

Send the appropriate force with this simulated click event.
* WebView/WebPDFViewPlaceholder.mm:
(-[WebPDFViewPlaceholder simulateClickOnLinkToURL:]):

Source/WebKit/mac:

PlatformMouseEvent and MouseEvent now take force parameters.
* WebView/WebFrame.mm:
(-[WebFrame _dragSourceEndedAt:operation:]):
* WebView/WebPDFView.mm:
(-[WebPDFView PDFViewWillClickOnLink:withURL:]):

Source/WebKit/win:

PlatformMouseEvent takes a force parameter.
* WebDropSource.cpp:
(generateMouseEvent):

Source/WebKit2:

In order to accommodate adding force to all PlatformMouseEvents, we have to add it
to pass a caches pressure event to NativeWebMouseEvent and add force to
WebMouseEvent.

NativeWebMouseEvent now requires a second NSEvent for the pressureEvent.
* Shared/NativeWebMouseEvent.h:

WebMouseEvent takes a force parameter.
* Shared/WebEvent.h:
(WebKit::WebMouseEvent::force):
* Shared/WebEventConversion.cpp:
(WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
* Shared/WebMouseEvent.cpp:
(WebKit::WebMouseEvent::WebMouseEvent):
(WebKit::WebMouseEvent::encode):
(WebKit::WebMouseEvent::decode):
* Shared/mac/NativeWebMouseEventMac.mm:
(WebKit::NativeWebMouseEvent::NativeWebMouseEvent):
* Shared/mac/WebEventFactory.h:
* Shared/mac/WebEventFactory.mm:
(WebKit::WebEventFactory::createWebMouseEvent):

Cache the most recent pressureEvent in _data so that it can be sent along to the
NativeWebMouseEvent constructor.
* UIProcess/API/mac/WKView.mm:
(-[WKView pressureChangeWithEvent:]):
(-[WKView acceptsFirstMouse:]):
(-[WKView shouldDelayWindowOrderingForEvent:]):
(-[WKView _postFakeMouseMovedEventForFlagsChangedEvent:]):
(-[WKView initWithFrame:processPool:configuration:webView:]):

WebMouseEvent takes a force parameter.
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::showContextMenuAtPoint):
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::createWebEvent):

MouseEvent and PlatformMouseEvent both take force parameters too.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::navigateToURLWithSimulatedClick):
(WebKit::WebPage::contextMenuAtPointInWindow):
(WebKit::WebPage::dragEnded):
(WebKit::WebPage::simulateMouseDown):
(WebKit::WebPage::simulateMouseUp):
(WebKit::WebPage::simulateMouseMotion):

The functions that dispatch the force events no longer take a PlatformMouseEvent
as a parameter.
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::inputDeviceForceDidChange):
(WebKit::WebPage::immediateActionDidCancel):

LayoutTests:

* platform/mac-mavericks/js/dom/global-constructors-attributes-expected.txt:
* platform/mac/js/dom/global-constructors-attributes-expected.txt:
* platform/win/js/dom/global-constructors-attributes-expected.txt:

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

5 years agoDon't segregate heap objects based on Structure immortality.
akling@apple.com [Mon, 13 Apr 2015 19:12:48 +0000 (19:12 +0000)]
Don't segregate heap objects based on Structure immortality.
<https://webkit.org/b/143638>

Reviewed by Darin Adler.

Source/JavaScriptCore:

Put all objects that need a destructor call into the same MarkedBlock.
This reduces memory consumption in many situations, while improving locality,
since much more of the MarkedBlock space can be shared.

Instead of branching on the MarkedBlock type, we now check a bit in the
JSCell's inline type flags (StructureIsImmortal) to see whether it's safe
to access the cell's Structure during destruction or not.

Performance benchmarks look mostly neutral. Maybe a small regression on
SunSpider's date objects.

On the amazon.com landing page, this saves us 50 MarkedBlocks (3200kB) along
with a bunch of WeakBlocks that were hanging off of them. That's on the higher
end of savings we can get from this, but still a very real improvement.

Most of this patch is removing the "hasImmortalStructure" constant from JSCell
derived classes and passing that responsibility to the StructureIsImmortal flag.
StructureFlags is made public so that it's accessible from non-member functions.
I made sure to declare it everywhere and make classes final to try to make it
explicit what each class is doing to its inherited flags.

* API/JSCallbackConstructor.h:
* API/JSCallbackObject.h:
* bytecode/UnlinkedCodeBlock.h:
* debugger/DebuggerScope.h:
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileMakeRope):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::compileMakeRope):
* heap/Heap.h:
(JSC::Heap::subspaceForObjectDestructor):
(JSC::Heap::allocatorForObjectWithDestructor):
(JSC::Heap::subspaceForObjectNormalDestructor): Deleted.
(JSC::Heap::subspaceForObjectsWithImmortalStructure): Deleted.
(JSC::Heap::allocatorForObjectWithNormalDestructor): Deleted.
(JSC::Heap::allocatorForObjectWithImmortalStructureDestructor): Deleted.
* heap/HeapInlines.h:
(JSC::Heap::allocateWithDestructor):
(JSC::Heap::allocateObjectOfType):
(JSC::Heap::subspaceForObjectOfType):
(JSC::Heap::allocatorForObjectOfType):
(JSC::Heap::allocateWithNormalDestructor): Deleted.
(JSC::Heap::allocateWithImmortalStructureDestructor): Deleted.
* heap/MarkedAllocator.cpp:
(JSC::MarkedAllocator::allocateBlock):
* heap/MarkedAllocator.h:
(JSC::MarkedAllocator::needsDestruction):
(JSC::MarkedAllocator::MarkedAllocator):
(JSC::MarkedAllocator::init):
(JSC::MarkedAllocator::destructorType): Deleted.
* heap/MarkedBlock.cpp:
(JSC::MarkedBlock::create):
(JSC::MarkedBlock::MarkedBlock):
(JSC::MarkedBlock::callDestructor):
(JSC::MarkedBlock::specializedSweep):
(JSC::MarkedBlock::sweep):
(JSC::MarkedBlock::sweepHelper):
* heap/MarkedBlock.h:
(JSC::MarkedBlock::needsDestruction):
(JSC::MarkedBlock::destructorType): Deleted.
* heap/MarkedSpace.cpp:
(JSC::MarkedSpace::MarkedSpace):
(JSC::MarkedSpace::resetAllocators):
(JSC::MarkedSpace::forEachAllocator):
(JSC::MarkedSpace::isPagedOut):
(JSC::MarkedSpace::clearNewlyAllocated):
* heap/MarkedSpace.h:
(JSC::MarkedSpace::subspaceForObjectsWithDestructor):
(JSC::MarkedSpace::destructorAllocatorFor):
(JSC::MarkedSpace::allocateWithDestructor):
(JSC::MarkedSpace::forEachBlock):
(JSC::MarkedSpace::subspaceForObjectsWithNormalDestructor): Deleted.
(JSC::MarkedSpace::subspaceForObjectsWithImmortalStructure): Deleted.
(JSC::MarkedSpace::immortalStructureDestructorAllocatorFor): Deleted.
(JSC::MarkedSpace::normalDestructorAllocatorFor): Deleted.
(JSC::MarkedSpace::allocateWithImmortalStructureDestructor): Deleted.
(JSC::MarkedSpace::allocateWithNormalDestructor): Deleted.
* inspector/JSInjectedScriptHost.h:
* inspector/JSInjectedScriptHostPrototype.h:
* inspector/JSJavaScriptCallFrame.h:
* inspector/JSJavaScriptCallFramePrototype.h:
* jsc.cpp:
* runtime/ArrayBufferNeuteringWatchpoint.h:
* runtime/ArrayConstructor.h:
* runtime/ArrayIteratorPrototype.h:
* runtime/BooleanPrototype.h:
* runtime/ClonedArguments.h:
* runtime/CustomGetterSetter.h:
* runtime/DateConstructor.h:
* runtime/DatePrototype.h:
* runtime/ErrorPrototype.h:
* runtime/ExceptionHelpers.h:
* runtime/Executable.h:
* runtime/GenericArguments.h:
* runtime/GetterSetter.h:
* runtime/InternalFunction.h:
* runtime/JSAPIValueWrapper.h:
* runtime/JSArgumentsIterator.h:
* runtime/JSArray.h:
* runtime/JSArrayBuffer.h:
* runtime/JSArrayBufferView.h:
* runtime/JSBoundFunction.h:
* runtime/JSCallee.h:
* runtime/JSCell.h:
* runtime/JSCellInlines.h:
(JSC::JSCell::classInfo):
* runtime/JSDataViewPrototype.h:
* runtime/JSEnvironmentRecord.h:
* runtime/JSFunction.h:
* runtime/JSGenericTypedArrayView.h:
* runtime/JSGlobalObject.h:
* runtime/JSLexicalEnvironment.h:
* runtime/JSNameScope.h:
* runtime/JSNotAnObject.h:
* runtime/JSONObject.h:
* runtime/JSObject.h:
(JSC::JSFinalObject::JSFinalObject):
* runtime/JSPromiseConstructor.h:
* runtime/JSPromiseDeferred.h:
* runtime/JSPromisePrototype.h:
* runtime/JSPromiseReaction.h:
* runtime/JSPropertyNameEnumerator.h:
* runtime/JSProxy.h:
* runtime/JSScope.h:
* runtime/JSString.h:
* runtime/JSSymbolTableObject.h:
* runtime/JSTypeInfo.h:
(JSC::TypeInfo::structureIsImmortal):
* runtime/MathObject.h:
* runtime/NumberConstructor.h:
* runtime/NumberPrototype.h:
* runtime/ObjectConstructor.h:
* runtime/PropertyMapHashTable.h:
* runtime/RegExp.h:
* runtime/RegExpConstructor.h:
* runtime/RegExpObject.h:
* runtime/RegExpPrototype.h:
* runtime/ScopedArgumentsTable.h:
* runtime/SparseArrayValueMap.h:
* runtime/StrictEvalActivation.h:
* runtime/StringConstructor.h:
* runtime/StringIteratorPrototype.h:
* runtime/StringObject.h:
* runtime/StringPrototype.h:
* runtime/Structure.cpp:
(JSC::Structure::Structure):
* runtime/Structure.h:
* runtime/StructureChain.h:
* runtime/StructureRareData.h:
* runtime/Symbol.h:
* runtime/SymbolPrototype.h:
* runtime/SymbolTable.h:
* runtime/WeakMapData.h:

Source/WebCore:

* bindings/js/JSDOMBinding.h:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GeneratePrototypeDeclaration):
* bridge/objc/objc_runtime.h:
* bridge/runtime_array.h:
* bridge/runtime_method.h:
* bridge/runtime_object.h:

Source/WebKit2:

* WebProcess/Plugins/Netscape/JSNPObject.h:

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

5 years agojavascript: links in inline PDFs shouldn't execute JavaScript in the context of the...
timothy_horton@apple.com [Mon, 13 Apr 2015 18:38:39 +0000 (18:38 +0000)]
javascript: links in inline PDFs shouldn't execute JavaScript in the context of the host website
https://bugs.webkit.org/show_bug.cgi?id=143642
<rdar://problem/18259355>

Reviewed by Darin Adler.

* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::clickedLink):
Don't follow javascript: URLs.

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

5 years agoDFG inlining of op_call_varargs should keep the callee alive in case of OSR exit.
mark.lam@apple.com [Mon, 13 Apr 2015 18:08:33 +0000 (18:08 +0000)]
DFG inlining of op_call_varargs should keep the callee alive in case of OSR exit.
https://bugs.webkit.org/show_bug.cgi?id=143407

Reviewed by Filip Pizlo.

DFG inlining of a varargs call / construct needs to keep the local
containing the callee alive with a Phantom node because the LoadVarargs
node may OSR exit.  After the OSR exit, the baseline JIT executes the
op_call_varargs with that callee in the local.

Previously, because that callee local was not explicitly kept alive,
the op_call_varargs case can OSR exit a DFG function and leave an
undefined value in that local.  As a result, the baseline observes the
side effect of an op_call_varargs on an undefined value instead of the
function it expected.

Note: this issue does not manifest with op_construct_varargs because
the inlined constructor will have an op_create_this which operates on
the incoming callee value, thereby keeping it alive.

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleInlining):
* tests/stress/call-varargs-with-different-arguments-length-after-warmup.js: Added.
(foo):
(Foo):
(doTest):

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

5 years agoClear up the test content when test is done.
zalan@apple.com [Mon, 13 Apr 2015 18:04:55 +0000 (18:04 +0000)]
Clear up the test content when test is done.

Unreviewed fix.

* Layout/simple-line-layout-innertext.html:

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

5 years agoFixed position element is truncated if moved onscreen by a transform
simon.fraser@apple.com [Mon, 13 Apr 2015 17:55:07 +0000 (17:55 +0000)]
Fixed position element is truncated if moved onscreen by a transform
https://bugs.webkit.org/show_bug.cgi?id=143655
Source/WebCore:

rdar://problem/15020044

Reviewed by Darin Adler.

Our "don't do layout if transform changes" code was too aggressive.
If an element changes between having a transform and not having one, we
really need to do a layout since so much else depends on transforms. In
this particular case, we clip position:fixed elements to the viewport if
they are not transformed, and were failing to re-evaluate this when a
transform was added. Doing a layout fixes this.

Test: compositing/geometry/fixed-transformed.html

* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::changeRequiresLayout):
* rendering/style/StyleTransformData.h:
(WebCore::StyleTransformData::hasTransform):

LayoutTests:

Reviewed by Darin Adler.

Test that moves a position:fixed element on-screen using a transform.

* compositing/geometry/fixed-transformed.html: Added.

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

5 years ago[Content Extensions] Don't unmap shared memory while using it.
achristensen@apple.com [Mon, 13 Apr 2015 17:54:22 +0000 (17:54 +0000)]
[Content Extensions] Don't unmap shared memory while using it.
https://bugs.webkit.org/show_bug.cgi?id=143625

Reviewed by Darin Adler.

* Shared/WebCompiledContentExtension.cpp:
(WebKit::WebCompiledContentExtension::createFromCompiledContentExtensionData):
* Shared/WebCompiledContentExtensionData.h:
(WebKit::WebCompiledContentExtensionData::WebCompiledContentExtensionData):
* UIProcess/API/APIUserContentExtensionStore.cpp:
(API::createExtension):
Keep the Data object alive as long as the SharedMemory that uses it.

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

5 years agojs/regress-141098.html often times out in debug builds.
ap@apple.com [Mon, 13 Apr 2015 17:50:44 +0000 (17:50 +0000)]
js/regress-141098.html often times out in debug builds.

This test is slow in debug, sometimes barely passing, and other times timing out.

* TestExpectations:

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

5 years ago[cmake] REGRESSION(182663): It broke feature dependency handling
mcatanzaro@igalia.com [Mon, 13 Apr 2015 17:42:22 +0000 (17:42 +0000)]
[cmake] REGRESSION(182663): It broke feature dependency handling
https://bugs.webkit.org/show_bug.cgi?id=143665

Reviewed by Csaba Osztrogonác.

Don't try to check the value of options before defining the options.

* Source/cmake/WebKitFeatures.cmake:

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

5 years ago[Win] Unreviewed test correction after r182635.
bfulgham@apple.com [Mon, 13 Apr 2015 17:42:03 +0000 (17:42 +0000)]
[Win] Unreviewed test correction after r182635.

Two Windows test expectation files were missing newlines at the end of the file.

* platform/win/fast/backgrounds/selection-background-color-of-image-list-style-expected.txt:
* platform/win/fast/backgrounds/selection-background-color-of-list-style-expected.txt:

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

5 years agobuild.webkit.org/dashboard: Crash-only queues should show failure when testing fails...
ap@apple.com [Mon, 13 Apr 2015 17:28:59 +0000 (17:28 +0000)]
build.webkit.org/dashboard: Crash-only queues should show failure when testing fails to start
https://bugs.webkit.org/show_bug.cgi?id=143656

Reviewed by Darin Adler.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotTesterQueueView.js:
(BuildbotTesterQueueView.prototype.update.appendBuilderQueueStatus):

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

5 years ago[Win] Unreviewed gardening after r182620. (<br> updates mostly)
zalan@apple.com [Mon, 13 Apr 2015 17:28:05 +0000 (17:28 +0000)]
[Win] Unreviewed gardening after r182620. (<br> updates mostly)

* platform/win/fast/dom/focus-contenteditable-expected.txt:
* platform/win/fast/forms/listbox-hit-test-zoomed-expected.txt:
* platform/win/fast/forms/range/slider-padding-expected.txt:
* platform/win/fast/forms/textarea-scroll-height-expected.txt:
* platform/win/fast/parser/open-comment-in-textarea-expected.txt:
* platform/win/fast/text/international/bidi-layout-across-linebreak-expected.txt:
* platform/win/fast/text/svg-font-face-with-kerning-expected.txt: Added.
* platform/win/http/tests/navigation/postredirect-basic-expected.txt:
* platform/win/http/tests/navigation/postredirect-goback1-expected.txt:
* platform/win/printing/single-line-must-not-be-split-into-two-pages-expected.txt:
* platform/win/svg/wicd/test-rightsizing-b-expected.txt:
* platform/win/tables/mozilla/bugs/bug1224-expected.txt:
* platform/win/tables/mozilla/bugs/bug131020-expected.txt:
* platform/win/tables/mozilla/bugs/bug131020_iframe-expected.txt:
* platform/win/tables/mozilla/bugs/bug1430-expected.txt:
* platform/win/tables/mozilla/bugs/bug16252-expected.txt:
* platform/win/tables/mozilla/bugs/bug19599-expected.txt:
* platform/win/tables/mozilla/bugs/bug20579-expected.txt:
* platform/win/tables/mozilla/bugs/bug32205-3-expected.txt:
* platform/win/tables/mozilla/bugs/bug82946-2-expected.txt:
* platform/win/tables/mozilla/bugs/bug92143-expected.txt:
* platform/win/tables/mozilla/marvin/tables_cellpadding-expected.txt:
* platform/win/tables/mozilla/marvin/tables_cellspacing-expected.txt:
* platform/win/tables/mozilla/other/wa_table_thtd_rowspan-expected.txt:
* platform/win/tables/mozilla_expected_failures/bugs/bug56024-expected.txt:
* platform/win/tables/mozilla_expected_failures/other/test4-expected.txt:

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

5 years ago[Win] Incorrect parameter order in call to WebView::repaint.
peavo@outlook.com [Mon, 13 Apr 2015 16:22:14 +0000 (16:22 +0000)]
[Win] Incorrect parameter order in call to WebView::repaint.
https://bugs.webkit.org/show_bug.cgi?id=143666

Reviewed by Brent Fulgham.

The 'immediate' default parameter has been forgotten.

* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::invalidateRootView):
(WebChromeClient::invalidateContentsAndRootView):
(WebChromeClient::invalidateContentsForSlowScroll):

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

5 years ago[Cocoa] Localizable strings are inconsistent and need to be regenerated
darin@apple.com [Mon, 13 Apr 2015 15:41:40 +0000 (15:41 +0000)]
[Cocoa] Localizable strings are inconsistent and need to be regenerated
https://bugs.webkit.org/show_bug.cgi?id=143661
Source/WebCore:

rdar://problem/19634388

Reviewed by Dan Bernstein.

* English.lproj/Localizable.strings: Updated by running the
update-webkit-localizable-strings script.

Source/WebKit/mac:

rdar://problem/19634388

Reviewed by Dan Bernstein.

* Misc/WebLocalizableStrings.mm:
(LoadWebLocalizedStringsTimerCallback): Moved the comment, useful for programmers but
not for localization, into a C++ source code comment, and made the localizer comment
consistent with the place this localizable string is used for actual localization.
* WebCoreSupport/WebEditorClient.mm:
(undoNameForEditAction): Changed the localizer comments for Delete and Dictation
to match the ones in WebKit2; no need to specify that these are iOS only, and if we do
want to specify that, we should not be using the term PLATFORM(IOS) since there is no
reason for us to expect localizers to understand that terminology. Also added a comment
about the fact that we have two copies of all the localizable strings.

Source/WebKit2:

Reviewed by Dan Bernstein.

* UIProcess/WebEditCommandProxy.cpp:
(WebKit::WebEditCommandProxy::nameForEditAction): Also added a comment
about the fact that we have two copies of all the localizable strings.

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

5 years agoRemove needless recreation of URL in NavigationScheduler::scheduleLocationChange
darin@apple.com [Mon, 13 Apr 2015 15:40:42 +0000 (15:40 +0000)]
Remove needless recreation of URL in NavigationScheduler::scheduleLocationChange
https://bugs.webkit.org/show_bug.cgi?id=143662

Reviewed by Sam Weinig.

* loader/NavigationScheduler.cpp:
(WebCore::NavigationScheduler::scheduleLocationChange): Removed unnecessary code
to convert a URL to a String and then back into a URL.

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

5 years agoREGRESSION(r181134): [GTK] Test /webkit2/WebKitWebView/insecure-content is failing...
svillar@igalia.com [Mon, 13 Apr 2015 15:06:23 +0000 (15:06 +0000)]
REGRESSION(r181134): [GTK] Test /webkit2/WebKitWebView/insecure-content is failing after r181134
https://bugs.webkit.org/show_bug.cgi?id=142387

Reviewed by Carlos Garcia Campos.

Running mixed content is blocked by default since r181134. Updated
the test case to reflect the new default settings.

* TestWebKitAPI/Tests/WebKit2Gtk/TestSSL.cpp:
(testInsecureContent):

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

5 years agoFix wrong value variable in ENABLE_NAVIGATOR_HWCONCURRENCY
gyuyoung.kim@webkit.org [Mon, 13 Apr 2015 14:46:49 +0000 (14:46 +0000)]
Fix wrong value variable in ENABLE_NAVIGATOR_HWCONCURRENCY
https://bugs.webkit.org/show_bug.cgi?id=143667

Reviewed by Csaba Osztrogonác.

ENABLE_NAVIGATOR_HWCONCURRENCY has used $registerProtocolHandlerSupport value variable
since r169017. Added $hardwareConcurrencySupport for it.

Additionally networkInfoSupport is removed because this feature was removed due to spec out.

* Scripts/webkitperl/FeatureList.pm:

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

5 years ago[cmake] Add ENABLE(ATTACHMENT_ELEMENT) to the build system
ossy@webkit.org [Mon, 13 Apr 2015 14:11:32 +0000 (14:11 +0000)]
[cmake] Add ENABLE(ATTACHMENT_ELEMENT) to the build system
https://bugs.webkit.org/show_bug.cgi?id=143664

Reviewed by Gyuyoung Kim.

.:

* Source/cmake/OptionsEfl.cmake:
* Source/cmake/OptionsGTK.cmake:
* Source/cmake/WebKitFeatures.cmake:
* Source/cmakeconfig.h.cmake:

Source/WebCore:

* page/efl/DragControllerEfl.cpp:
(WebCore::DragController::declareAndWriteAttachment): Added stub implementation to fix the build.
* page/gtk/DragControllerGtk.cpp:
(WebCore::DragController::declareAndWriteAttachment): Added stub implementation to fix the build.

Tools:

* Scripts/webkitperl/FeatureList.pm:

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

5 years ago[EFL] Update table/mozilla expected files after r182620
ossy@webkit.org [Mon, 13 Apr 2015 14:08:39 +0000 (14:08 +0000)]
[EFL] Update table/mozilla expected files after r182620
https://bugs.webkit.org/show_bug.cgi?id=143626

Unreviewed gardening.

* platform/efl/TestExpectations:
* platform/efl/tables/mozilla/bugs/bug106795-expected.png:
* platform/efl/tables/mozilla/bugs/bug106795-expected.txt:
* platform/efl/tables/mozilla/bugs/bug1224-expected.png:
* platform/efl/tables/mozilla/bugs/bug1224-expected.txt:
* platform/efl/tables/mozilla/bugs/bug131020-expected.png:
* platform/efl/tables/mozilla/bugs/bug131020-expected.txt:
* platform/efl/tables/mozilla/bugs/bug131020_iframe-expected.png:
* platform/efl/tables/mozilla/bugs/bug131020_iframe-expected.txt:
* platform/efl/tables/mozilla/bugs/bug1430-expected.png:
* platform/efl/tables/mozilla/bugs/bug1430-expected.txt:
* platform/efl/tables/mozilla/bugs/bug157890-expected.png:
* platform/efl/tables/mozilla/bugs/bug157890-expected.txt: Added.
* platform/efl/tables/mozilla/bugs/bug16252-expected.png:
* platform/efl/tables/mozilla/bugs/bug16252-expected.txt:
* platform/efl/tables/mozilla/bugs/bug19599-expected.png:
* platform/efl/tables/mozilla/bugs/bug19599-expected.txt:
* platform/efl/tables/mozilla/bugs/bug20579-expected.png:
* platform/efl/tables/mozilla/bugs/bug20579-expected.txt:
* platform/efl/tables/mozilla/bugs/bug32205-3-expected.png:
* platform/efl/tables/mozilla/bugs/bug32205-3-expected.txt:
* platform/efl/tables/mozilla/bugs/bug82946-2-expected.png:
* platform/efl/tables/mozilla/bugs/bug82946-2-expected.txt:
* platform/efl/tables/mozilla/bugs/bug92143-expected.png:
* platform/efl/tables/mozilla/bugs/bug92143-expected.txt:
* platform/efl/tables/mozilla/marvin/tables_cellpadding-expected.png:
* platform/efl/tables/mozilla/marvin/tables_cellpadding-expected.txt:
* platform/efl/tables/mozilla/marvin/tables_cellspacing-expected.png:
* platform/efl/tables/mozilla/marvin/tables_cellspacing-expected.txt:
* platform/efl/tables/mozilla/other/wa_table_thtd_rowspan-expected.png:
* platform/efl/tables/mozilla/other/wa_table_thtd_rowspan-expected.txt:
* platform/efl/tables/mozilla_expected_failures/bugs/bug1262-expected.png:
* platform/efl/tables/mozilla_expected_failures/bugs/bug1262-expected.txt:
* platform/efl/tables/mozilla_expected_failures/bugs/bug56024-expected.png:
* platform/efl/tables/mozilla_expected_failures/bugs/bug56024-expected.txt:
* platform/efl/tables/mozilla_expected_failures/other/test4-expected.png:
* platform/efl/tables/mozilla_expected_failures/other/test4-expected.txt:

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

5 years ago[Curl] Small improvements to CurlCacheEntry::parseResponseHeaders()
commit-queue@webkit.org [Mon, 13 Apr 2015 14:05:37 +0000 (14:05 +0000)]
[Curl] Small improvements to CurlCacheEntry::parseResponseHeaders()
https://bugs.webkit.org/show_bug.cgi?id=143597

Patch by Sungmann Cho <sungmann.cho@navercorp.com> on 2015-04-13
Reviewed by Csaba Osztrogonác.

Most lines of code in CurlCacheEntry::parseResponseHeaders() don't need to be
executed if the response has "no-cache" or "no-store" directive, but we are
checking these conditions in the middle of the method. We can move this to the
beginning of the method for efficiency.

No new tests, no behavior change.

* platform/network/curl/CurlCacheEntry.cpp:
(WebCore::CurlCacheEntry::parseResponseHeaders):

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

5 years ago[EFL] Unreviewed gardening, skip fast/attachment tests, there is
ossy@webkit.org [Mon, 13 Apr 2015 13:59:37 +0000 (13:59 +0000)]
[EFL] Unreviewed gardening, skip fast/attachment tests, there is
no reason to run these tests before enabling ATTACHMENT_ELEMENT.

* platform/efl/TestExpectations:

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

5 years agoUnreviewed, build fix after r182704.
svillar@igalia.com [Mon, 13 Apr 2015 13:20:09 +0000 (13:20 +0000)]
Unreviewed, build fix after r182704.

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):

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

5 years agoUse std::unique_ptr instead of PassOwnPtr|OwnPtr for ResourceResponse
commit-queue@webkit.org [Mon, 13 Apr 2015 11:18:04 +0000 (11:18 +0000)]
Use std::unique_ptr instead of PassOwnPtr|OwnPtr for ResourceResponse
https://bugs.webkit.org/show_bug.cgi?id=143056

Patch by Joonghun Park <jh718.park@samsung.com> on 2015-04-13
Reviewed by Gyuyoung Kim.

No new tests, no behavior changes.

* loader/WorkerThreadableLoader.cpp:
(WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
(WebCore::WorkerThreadableLoader::MainThreadBridge::didReceiveResponse):
* platform/CrossThreadCopier.h:
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::adopt):
(WebCore::ResourceResponseBase::copyData):
* platform/network/ResourceResponseBase.h:
* platform/network/cf/ResourceResponse.h:
(WebCore::ResourceResponse::doPlatformCopyData):
(WebCore::ResourceResponse::doPlatformAdopt):
* platform/network/curl/ResourceResponse.h:
(WebCore::ResourceResponse::doPlatformCopyData):
(WebCore::ResourceResponse::doPlatformAdopt):
* platform/network/soup/ResourceResponse.h:
(WebCore::ResourceResponse::doPlatformCopyData):
(WebCore::ResourceResponse::doPlatformAdopt):

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

5 years ago[CSS Grid Layout] Support marking/unmarking tracks as infinitely growable
svillar@igalia.com [Mon, 13 Apr 2015 10:49:43 +0000 (10:49 +0000)]
[CSS Grid Layout] Support marking/unmarking tracks as infinitely growable
https://bugs.webkit.org/show_bug.cgi?id=141431

Reviewed by Darin Adler.

Source/WebCore:

As explained here
http://lists.w3.org/Archives/Public/www-style/2014Mar/0512.html we
sometimes need to consider that some tracks are infinitely
growable even when they are really not, in order to produce more
"natural" results.

For example the following case:
  grid-template-columns: auto auto;
  item 1 in column 1 with min-content = max-content = 10px;
  item 2 in columns 1-2 with min-content = 30, max-content = 100px;

will produce (45px, 55px) without this patch. But considering the
second column as infinitely growable the result is (10px, 90px), a
more "natural" result because column 1 just needs to be 10px to
accommodate item 1. From now on we can flag GridTracks so that
they can infinitely grow even when the growth limit is finite.

Apart from that distributeSpaceToTracks() is now unconditionally
called even though the extra space is 0. That's because it
computes the plannedSize value.

Test: fast/css-grid-layout/mark-as-infinitely-growable.html

* rendering/RenderGrid.cpp:
(WebCore::GridTrack::infiniteGrowthPotential):
(WebCore::GridTrack::infinitelyGrowable):
(WebCore::GridTrack::setInfinitelyGrowable):
(WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
(WebCore::RenderGrid::trackSizeForTrackSizeComputationPhase): Updated with new phase.
(WebCore::RenderGrid::shouldProcessTrackForTrackSizeComputationPhase): Ditto.
(WebCore::RenderGrid::trackShouldGrowBeyondGrowthLimitsForTrackSizeComputationPhase): Ditto.
(WebCore::RenderGrid::updateTrackSizeForTrackSizeComputationPhase): Ditto.
(WebCore::RenderGrid::currentItemSizeForTrackSizeComputationPhase): Ditto.
(WebCore::RenderGrid::markAsInfinitelyGrowableForTrackSizeComputationPhase):
New helper method which does the mark/unmark just for growth limits.
(WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
(WebCore::sortByGridTrackGrowthPotential): Use
infiniteGrowthPotential() for sorting.
(WebCore::RenderGrid::distributeSpaceToTracks):
* rendering/RenderGrid.h:

LayoutTests:

New test that to check that tracks whose growth limit changes from
infinite to finite when evaluating "intrinsic maximums" are marked
as infinitely growable for the "max-content maximums" step.

* fast/css-grid-layout/mark-as-infinitely-growable-expected.txt: Added.
* fast/css-grid-layout/mark-as-infinitely-growable.html: Added.

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