WebKit-https.git
4 years agoUnreviewed, revert accidental commit.
fpizlo@apple.com [Wed, 8 Apr 2015 20:24:40 +0000 (20:24 +0000)]
Unreviewed, revert accidental commit.

* Makefile.shared:

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

4 years agoDFG::IntegerCheckCombiningPhase's wrap-around check shouldn't trigger C++ undef behav...
fpizlo@apple.com [Wed, 8 Apr 2015 20:22:53 +0000 (20:22 +0000)]
DFG::IntegerCheckCombiningPhase's wrap-around check shouldn't trigger C++ undef behavior on wrap-around
https://bugs.webkit.org/show_bug.cgi?id=143532

Reviewed by Gavin Barraclough.

Oh the irony!  We were protecting an optimization that only worked if there was no wrap-around in JavaScript.
But the C++ code had wrap-around, which is undef in C++.  So, if the compiler was smart enough, our compiler
would think that there never was wrap-around.

This fixes a failure in stress/tricky-array-boiunds-checks.js when JSC is compiled with bleeding-edge clang.

* dfg/DFGIntegerCheckCombiningPhase.cpp:
(JSC::DFG::IntegerCheckCombiningPhase::isValid):

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

4 years ago[GTK] Unreviewed test expectation sanity-check
mcatanzaro@igalia.com [Wed, 8 Apr 2015 20:09:59 +0000 (20:09 +0000)]
[GTK] Unreviewed test expectation sanity-check

Remove duplicate expectation, and some expectations for tests that no longer exist.

* platform/gtk/TestExpectations:

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

4 years ago[CSS Shapes] Properly handle negative reference box widths and center coordinates
bjonesbe@adobe.com [Wed, 8 Apr 2015 19:40:43 +0000 (19:40 +0000)]
[CSS Shapes] Properly handle negative reference box widths and center coordinates
https://bugs.webkit.org/show_bug.cgi?id=142610

Reviewed by Rob Buis.
Source/WebCore:

Fix a few cases where values that should not be negative end up that
way.

This patch is based on a couple of Blink patches by Rob Buis.

Tests: fast/shapes/shape-outside-floats/shape-outside-floats-circle-negative-radius-crash.html
       fast/shapes/shape-outside-floats/shape-outside-floats-ellipse-negative-width-crash.html

* rendering/shapes/ShapeOutsideInfo.cpp:
(WebCore::ShapeOutsideInfo::computeDeltasForContainingBlockLine): A
    negative margin box width means that the shape has no extent, so
    clamp to zero.
* rendering/style/BasicShapes.cpp:
(WebCore::BasicShapeCircle::floatValueForRadiusInBox): When computing
    the radii, take the absolute value, since the radii is based on
    the distance, which is always positive.
(WebCore::BasicShapeEllipse::floatValueForRadiusInBox): Ditto.

LayoutTests:

Tests for the cases that trigger asserts.

* fast/shapes/shape-outside-floats/shape-outside-floats-circle-negative-radius-crash-expected.txt: Added.
* fast/shapes/shape-outside-floats/shape-outside-floats-circle-negative-radius-crash.html: Added.
* fast/shapes/shape-outside-floats/shape-outside-floats-ellipse-negative-width-crash-expected.txt: Added.
* fast/shapes/shape-outside-floats/shape-outside-floats-ellipse-negative-width-crash.html: Added.

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

4 years agoAdd a WebApplicationCache::storage() and use it instead of the WebCore singleton
andersca@apple.com [Wed, 8 Apr 2015 19:28:34 +0000 (19:28 +0000)]
Add a WebApplicationCache::storage() and use it instead of the WebCore singleton
https://bugs.webkit.org/show_bug.cgi?id=143525

Reviewed by Antti Koivisto.

* WebApplicationCache.cpp:
(WebApplicationCache::storage):
(WebApplicationCache::maximumSize):
(WebApplicationCache::setMaximumSize):
(WebApplicationCache::defaultOriginQuota):
(WebApplicationCache::setDefaultOriginQuota):
(WebApplicationCache::diskUsageForOrigin):
(WebApplicationCache::deleteAllApplicationCaches):
(WebApplicationCache::deleteCacheForOrigin):
(WebApplicationCache::originsWithCache):
* WebApplicationCache.h:

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

4 years agoUnreviewed, rolling out r182522.
commit-queue@webkit.org [Wed, 8 Apr 2015 18:44:58 +0000 (18:44 +0000)]
Unreviewed, rolling out r182522.
https://bugs.webkit.org/show_bug.cgi?id=143529

Not needed any more (Requested by ap on #webkit).

Reverted changeset:

"Fix the build."
http://trac.webkit.org/changeset/182522

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

4 years ago32-bit build fix after r182554.
enrica@apple.com [Wed, 8 Apr 2015 18:30:47 +0000 (18:30 +0000)]
32-bit build fix after r182554.

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

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

4 years agoForce events should not require preventDefault in order to fire
bdakin@apple.com [Wed, 8 Apr 2015 18:25:25 +0000 (18:25 +0000)]
Force events should not require preventDefault in order to fire
https://bugs.webkit.org/show_bug.cgi?id=143503
-and corresponding-
rdar://problem/20458916

Reviewed by Tim Horton.

Source/WebCore:

Since these events will fire whether or not preventDefault was set on the
willBegin event, we should make sure we only send them when there are registered
event listeners. These are new events, so we don’t want to spam the vast majority
of web content that doesn’t use them yet.
* dom/Document.cpp:
(WebCore::Document::addListenerTypeIfNeeded):
* dom/Document.h:
* dom/Element.cpp:
(WebCore::Element::dispatchMouseForceWillBegin):
(WebCore::Element::dispatchMouseForceChanged):
(WebCore::Element::dispatchMouseForceDown):
(WebCore::Element::dispatchMouseForceUp):
(WebCore::Element::dispatchMouseForceClick):
(WebCore::Element::dispatchMouseForceCancelled):

Source/WebKit2:

We no longer need m_lastActionMenuHitTestPreventsDefault since we’ll always
dispatch the events to Element.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::performActionMenuHitTestAtLocation):
(WebKit::WebPage::inputDeviceForceDidChange):
(WebKit::WebPage::immediateActionDidCancel):

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

4 years ago[Mac][WebAudio] Update the AVAudioMix in the AudioSourceProviderAVFObjC when the...
jer.noble@apple.com [Wed, 8 Apr 2015 18:12:56 +0000 (18:12 +0000)]
[Mac][WebAudio] Update the AVAudioMix in the AudioSourceProviderAVFObjC when the list of enabled audio tracks change.
https://bugs.webkit.org/show_bug.cgi?id=143332

Reviewed by Eric Carlson.

Some media assets (notably, mp3s) will not have an enabled audio track when the AVAsset is
first loaded, so the AVAudioMix will have no trackID in it's parameters. Whenever the list
of enabled tracks change, recreate the AVAudioMix with the new first enabled audio trackID.

To facilitate this, add a new setter to AudioSourceProviderAVFObjC taking an AVAssetTrack to
use with the AVAudioMix. Whenever this parameter changes, the AVAudioMix is destroyed and
recreated.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerEngineUpdated): Drive-by fix: when the media
    player switches engines, re-associate the audio source node with its provider.
* platform/graphics/avfoundation/AudioSourceProviderAVFObjC.h:
* platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
(WebCore::AudioSourceProviderAVFObjC::setPlayerItem): Only create the mix if there is a valid AVPlayerItem and AVAssetTrack
(WebCore::AudioSourceProviderAVFObjC::setAudioTrack): Ditto.
(WebCore::AudioSourceProviderAVFObjC::createMix): Don't iterate over the AVPlayerItem's tracks,
    just use the one passed in through setAudioTrack().
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad): Clear the provider's track.
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem): Set the provider's track.
(WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged): Ditto.
(WebCore::MediaPlayerPrivateAVFoundationObjC::audioSourceProvider): Ditto.

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

4 years agoCalling makeFirstResponder on WKWebView doesn't work.
enrica@apple.com [Wed, 8 Apr 2015 18:06:58 +0000 (18:06 +0000)]
Calling makeFirstResponder on WKWebView doesn't work.
https://bugs.webkit.org/show_bug.cgi?id=143482
rdar://problem/20298166

Reviewed by Dan Bernstein.

Adding forwarding of the responder status to the WKView.
We also need to avoid doing any cleanup in resignFirstResponder
if we know we are about to regain responder status again.
Same goes for becomeFirstResponder.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView becomeFirstResponder]):
(-[WKWebView acceptsFirstResponder]):
* UIProcess/API/mac/WKView.mm:
(-[WKView becomeFristResponder]):
(-[WKView resignFirstResponder]):

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

4 years agoMove some ApplicationCache static member functions to ApplicationCacheStorage
andersca@apple.com [Wed, 8 Apr 2015 17:52:15 +0000 (17:52 +0000)]
Move some ApplicationCache static member functions to ApplicationCacheStorage
https://bugs.webkit.org/show_bug.cgi?id=143524

Reviewed by Antti Koivisto.

Source/WebCore:

This is yet another step towards eliminating ApplicationCacheStorage::singleton() and making the storage be per page instead.

* loader/appcache/ApplicationCache.cpp:
(WebCore::ApplicationCache::deleteCacheForOrigin):
(WebCore::ApplicationCache::deleteAllCaches):
(WebCore::ApplicationCache::diskUsageForOrigin):
* loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::ApplicationCacheStorage::deleteAllCaches):
(WebCore::ApplicationCacheStorage::deleteCacheForOrigin):
(WebCore::ApplicationCacheStorage::diskUsageForOrigin):
* loader/appcache/ApplicationCacheStorage.h:

Source/WebKit/mac:

* WebCoreSupport/WebApplicationCache.mm:
(+[WebApplicationCache diskUsageForOrigin:]):
(+[WebApplicationCache deleteAllApplicationCaches]):
(+[WebApplicationCache deleteCacheForOrigin:]):

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

4 years agoVersioning.
bshafiei@apple.com [Wed, 8 Apr 2015 17:27:33 +0000 (17:27 +0000)]
Versioning.

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

4 years agoFill list style background with same color with that of list background.
changseok.oh@collabora.com [Wed, 8 Apr 2015 17:14:07 +0000 (17:14 +0000)]
Fill list style background with same color with that of list background.
https://bugs.webkit.org/show_bug.cgi?id=143483

Reviewed by Simon Fraser.

Source/WebCore:

LayoutListMarker does not have a node so its selectionBackgroundColor alway returns
the default theme color for selection. We can make it more natural by filling
the same color with that of LayoutListItem into it.

Tests: fast/backgrounds/selection-background-color-of-image-list-style.html
       fast/backgrounds/selection-background-color-of-list-style.html

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

LayoutTests:

* fast/backgrounds/selection-background-color-of-image-list-style.html: Added.
* fast/backgrounds/selection-background-color-of-list-style.html: Added.
* platform/gtk/fast/backgrounds/selection-background-color-of-image-list-style-expected.png: Added.
* platform/gtk/fast/backgrounds/selection-background-color-of-image-list-style-expected.txt: Added.
* platform/gtk/fast/backgrounds/selection-background-color-of-list-style-expected.png: Added.
* platform/gtk/fast/backgrounds/selection-background-color-of-list-style-expected.txt: Added.
* platform/mac/fast/backgrounds/selection-background-color-of-image-list-style-expected.png: Added.
* platform/mac/fast/backgrounds/selection-background-color-of-image-list-style-expected.txt: Added.
* platform/mac/fast/backgrounds/selection-background-color-of-list-style-expected.png: Added.
* platform/mac/fast/backgrounds/selection-background-color-of-list-style-expected.txt: Added.

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

4 years agoAdd CMake build system for WinCairo port.
achristensen@apple.com [Wed, 8 Apr 2015 16:47:56 +0000 (16:47 +0000)]
Add CMake build system for WinCairo port.
https://bugs.webkit.org/show_bug.cgi?id=115944

Patch by Alex Christensen  <achristensen@webkit.org> and Patrick Gansterer <paroga@webkit.org> on 2015-04-08
Reviewed by Chris Dumez.

.:

* Source/cmake/OptionsWindows.cmake:
* Source/cmake/WebKitMacros.cmake:
Make ADD_PRECOMPILED_HEADER more like http://stackoverflow.com/questions/148570/using-pre-compiled-headers-with-cmake

Source/WebCore:

* CMakeLists.txt:
* PlatformWin.cmake:
* PlatformWinCairo.cmake:
* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::TextureMapperGL::TextureMapperGL):

Source/WebKit:

* CMakeLists.txt:

Source/WTF:

* wtf/FeatureDefines.h:
* wtf/PlatformWin.cmake:

Tools:

* CMakeLists.txt:
* WinLauncher/CMakeLists.txt: Added.

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

4 years agoRename ActiveDOMObject::canSuspend() to canSuspendForPageCache() for clarity
cdumez@apple.com [Wed, 8 Apr 2015 16:45:01 +0000 (16:45 +0000)]
Rename ActiveDOMObject::canSuspend() to canSuspendForPageCache() for clarity
https://bugs.webkit.org/show_bug.cgi?id=143513

Reviewed by Andreas Kling.

Source/WebCore:

Rename ActiveDOMObject::canSuspend() to canSuspendForPageCache() for
clarity as it is only used for the page cache. Also rename the
'DocumentWillBecomeInactive' value of the ReasonForSuspension enum to
'PageCache' as it is only used by CachedFrame for the page cache and it
is a lot more understandable.

Source/WebKit/mac:

Update ScriptExecutionContext::canSuspendActiveDOMObjects() to
canSuspendActiveDOMObjectsForPageCache() as the method was renamed.

* WebView/WebFrame.mm:
(-[WebFrame _cacheabilityDictionary]):

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

4 years agoUnreviewed, rolling out r182536.
commit-queue@webkit.org [Wed, 8 Apr 2015 16:25:54 +0000 (16:25 +0000)]
Unreviewed, rolling out r182536.
https://bugs.webkit.org/show_bug.cgi?id=143523

Made accessibility/table-sections.html time out on debug bots
(Requested by ap on #webkit).

Reverted changeset:

"Simple line layout: Add <br> support."
https://bugs.webkit.org/show_bug.cgi?id=139012
http://trac.webkit.org/changeset/182536

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

4 years agoGet rid of uses of ApplicationCacheStorage::singleton() from WebKitLegacy
andersca@apple.com [Wed, 8 Apr 2015 16:10:56 +0000 (16:10 +0000)]
Get rid of uses of ApplicationCacheStorage::singleton() from WebKitLegacy
https://bugs.webkit.org/show_bug.cgi?id=143504

Reviewed by Sam Weinig.

Source/WebKit:

* WebKit.xcodeproj/project.pbxproj:
Add WebApplicationCacheInternal.h.

Source/WebKit/mac:

Add a webApplicationCacheStorage() function and use it throughout WebKitLegacy.
In the future, webApplicationCacheStorage will return a custom singleton, but for now
it just returns ApplicationCacheStorage::singleton().

* Misc/WebCache.mm:
(+[WebCache empty]):
* WebCoreSupport/WebApplicationCache.mm:
(+[WebApplicationCache maximumSize]):
(+[WebApplicationCache setMaximumSize:]):
(+[WebApplicationCache defaultOriginQuota]):
(+[WebApplicationCache setDefaultOriginQuota:]):
(+[WebApplicationCache originsWithCache]):
(webApplicationCacheStorage):
* WebCoreSupport/WebApplicationCacheInternal.h: Added.
* WebCoreSupport/WebApplicationCacheQuotaManager.mm:
(-[WebApplicationCacheQuotaManager usage]):
(-[WebApplicationCacheQuotaManager quota]):
(-[WebApplicationCacheQuotaManager setQuota:]):
* WebView/WebView.mm:
(WebKitInitializeApplicationCachePathIfNecessary):

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

4 years ago[GTK] Crash in DOMObjectCache when a wrapped object owned by the cache is unreffed...
carlosgc@webkit.org [Wed, 8 Apr 2015 15:29:25 +0000 (15:29 +0000)]
[GTK] Crash in DOMObjectCache when a wrapped object owned by the cache is unreffed by the user
https://bugs.webkit.org/show_bug.cgi?id=143521

Reviewed by Martin Robinson.

This is a case we claim to support, but it only works if the
object has only one reference. In that case, when the user unrefs
it, the weak ref notify callback removes the object from the
cache. However, if the object has more than one ref, the cache
doesn't know the user unreffed it, and when clearing the cache we
try to remove more references than what the object actually has,
causing a crash in g_object_unref.

* bindings/gobject/DOMObjectCache.cpp:
(WebKit::DOMObjectCacheData::clearObject):

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

4 years agoSimple line layout: Add <br> support.
zalan@apple.com [Wed, 8 Apr 2015 15:11:56 +0000 (15:11 +0000)]
Simple line layout: Add <br> support.
https://bugs.webkit.org/show_bug.cgi?id=139012

This patch enables RenderBlockFlows to use simple line layout on text content when <br> is present.
Simple text with <br> is a fairly common pattern on discussion(forum)-like web pages. This patch reduces memory usage
and speeds up layout for such content.

Source/WebCore:

PerformanceTest/layout/line-layout-simple.html shows more than 2x speedup, when each paragraph is modified by appending <br> to the end.
With <br> support enabled:
  mean: 70.02391461289068 runs/s
  median: 70.47986488932318 runs/s

While with <br> support disabled:
  mean: 30.417295049468184 runs/s
  median: 30.36517778760357 runs/s

Reviewed by Antti Koivisto.

Test: fast/text/simple-line-with-br.html

* editing/TextIterator.cpp:
(WebCore::TextIterator::handleTextNode):
* rendering/RenderBlock.h:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::setSelectionState):
(WebCore::RenderBlockFlow::deleteLineBoxesBeforeSimpleLineLayout):
* rendering/RenderBlockFlow.h:
* rendering/RenderLineBreak.cpp:
(WebCore::simpleLineLayout):
(WebCore::ensureLineBoxes):
(WebCore::RenderLineBreak::deleteLineBoxesBeforeSimpleLineLayout):
(WebCore::RenderLineBreak::positionForPoint):
(WebCore::RenderLineBreak::setSelectionState):
(WebCore::RenderLineBreak::linesBoundingBox):
(WebCore::RenderLineBreak::absoluteRects):
(WebCore::RenderLineBreak::absoluteQuads):
(WebCore::RenderLineBreak::collectSelectionRects):
* rendering/RenderLineBreak.h:
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseFor):
(WebCore::SimpleLineLayout::LineState::removeTrailingWhitespace):
(WebCore::SimpleLineLayout::removeTrailingWhitespace):
(WebCore::SimpleLineLayout::consumeLineBreakIfNeeded):
(WebCore::SimpleLineLayout::skipWhitespaceIfNeeded):
(WebCore::SimpleLineLayout::firstFragment):
(WebCore::SimpleLineLayout::forceFragmentToLine):
(WebCore::SimpleLineLayout::createLineRuns):
(WebCore::SimpleLineLayout::create):
* rendering/SimpleLineLayoutFlowContents.cpp:
(WebCore::SimpleLineLayout::initializeSegments):
(WebCore::SimpleLineLayout::FlowContents::segmentForRenderer): Deleted.
* rendering/SimpleLineLayoutFlowContents.h:
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::paintFlow):
(WebCore::SimpleLineLayout::hitTestFlow):
(WebCore::SimpleLineLayout::showLineLayoutForFlow):
* rendering/SimpleLineLayoutResolver.cpp:
(WebCore::SimpleLineLayout::RunResolver::Run::rect):
(WebCore::SimpleLineLayout::RunResolver::RunResolver):
(WebCore::SimpleLineLayout::RunResolver::rangeForRenderer):
* rendering/SimpleLineLayoutResolver.h:
(WebCore::SimpleLineLayout::RunResolver::Iterator::inQuirksMode):
(WebCore::SimpleLineLayout::RunResolver::Iterator::operator--):
* rendering/SimpleLineLayoutTextFragmentIterator.cpp:
(WebCore::SimpleLineLayout::EndOfSegmentSetter::EndOfSegmentSetter):
(WebCore::SimpleLineLayout::EndOfSegmentSetter::~EndOfSegmentSetter):
(WebCore::SimpleLineLayout::TextFragmentIterator::nextTextFragment):
(WebCore::SimpleLineLayout::TextFragmentIterator::revertToFragment):
(WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
* rendering/SimpleLineLayoutTextFragmentIterator.h:
(WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::isLastInRenderer):
(WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::isLineBreak):
(WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::isEmpty):
(WebCore::SimpleLineLayout::TextFragmentIterator::isSoftLineBreak):
(WebCore::SimpleLineLayout::TextFragmentIterator::isHardLineBreak):
(WebCore::SimpleLineLayout::TextFragmentIterator::isLineBreak): Deleted.

LayoutTests:

Test output changes in 2 different ways:
1. Repositioned RenderLineBreak elements. (1px wide <br> is the result of integral pixel snapping)
2. Removed empty content (<br>).

Reviewed by Antti Koivisto.

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

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

4 years agoLazily initialize LogToSystemConsole flag to reduce memory usage
msaboff@apple.com [Wed, 8 Apr 2015 14:03:26 +0000 (14:03 +0000)]
Lazily initialize LogToSystemConsole flag to reduce memory usage
https://bugs.webkit.org/show_bug.cgi?id=143506

Reviewed by Mark Lam.

Only call into CF preferences code when we need to in order to reduce memory usage.

* inspector/JSGlobalObjectConsoleClient.cpp:
(Inspector::JSGlobalObjectConsoleClient::logToSystemConsole):
(Inspector::JSGlobalObjectConsoleClient::setLogToSystemConsole):
(Inspector::JSGlobalObjectConsoleClient::initializeLogToSystemConsole):
(Inspector::JSGlobalObjectConsoleClient::JSGlobalObjectConsoleClient):

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

4 years ago[GStreamer] compress property for the HTTP source element
philn@webkit.org [Wed, 8 Apr 2015 10:32:24 +0000 (10:32 +0000)]
[GStreamer] compress property for the HTTP source element
https://bugs.webkit.org/show_bug.cgi?id=143518

Reviewed by Carlos Garcia Campos.

Added a compress property so the default behavior or not
requesting content encoded to the server can be overridden if
needed. This is useful for adaptive streaming playback.

* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webKitWebSrcSetProperty):
(webKitWebSrcGetProperty):
(webKitWebSrcStart):

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

4 years agoRemove CSS functions min() and max() which had been dropped from specification
commit-queue@webkit.org [Wed, 8 Apr 2015 07:44:50 +0000 (07:44 +0000)]
Remove CSS functions min() and max() which had been dropped from specification
https://bugs.webkit.org/show_bug.cgi?id=143440

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

No new tests, No Behavior changes.

* css/CSSCalculationValue.cpp:
(WebCore::CSSCalcValue::create):
* css/CSSParser.cpp:
(WebCore::CSSParser::isCalculation):

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

4 years ago[GStreamer] extra-headers and keep-alive properties for HTTP source element
philn@webkit.org [Wed, 8 Apr 2015 07:09:30 +0000 (07:09 +0000)]
[GStreamer] extra-headers and keep-alive properties for HTTP source element
https://bugs.webkit.org/show_bug.cgi?id=143480

Reviewed by Carlos Garcia Campos.

Keep the resource loader around when persistent HTTP connection
support is enabled. The keep-alive property is set to false by
default. Also before sending the HTTP request we now check the
contents of the extra-headers GstStructure and set additional
headers based on the structure contents.

Patch inspired by GStreamer's souphttpsrc element.

* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webkit_web_src_init):
(webKitWebSrcFinalize):
(webKitWebSrcSetProperty):
(webKitWebSrcGetProperty):
(webKitWebSrcStop): Clear resource loader only for non-persistent connections.
(webKitWebSrcSetExtraHeader): Utility function to append headers
to an existing request based on a GValue contents.
(webKitWebSrcProcessExtraHeaders): Parse a GValue and set headers
based on its contents.
(webKitWebSrcStart): Extra headers and persistent connection
support. The resource loader is now lazily initialized here.

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

4 years agoFix the build.
simon.fraser@apple.com [Wed, 8 Apr 2015 06:41:03 +0000 (06:41 +0000)]
Fix the build.

* platform/graphics/cocoa/FontCascadeCocoa.mm:
(WebCore::FontCascade::drawGlyphs):
* platform/spi/cg/CoreGraphicsSPI.h:

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

4 years agoUnreviewed, another iOS build fix after r182516.
cdumez@apple.com [Wed, 8 Apr 2015 06:03:32 +0000 (06:03 +0000)]
Unreviewed, another iOS build fix after r182516.

I missed another use of __MAC_OS_X_VERSION_MIN_REQUIRED without a
PLATFORM(MAC) check.

* platform/graphics/cocoa/FontCascadeCocoa.mm:

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

4 years agoBug 142887 - role progress bar does not support indeterminate state
commit-queue@webkit.org [Wed, 8 Apr 2015 05:57:02 +0000 (05:57 +0000)]
Bug 142887 - role progress bar does not support indeterminate state
https://bugs.webkit.org/show_bug.cgi?id=142887

Patch by Michael Peechatt <mpeechatt@gmail.com> on 2015-04-07
Reviewed by Chris Fleizach.

Source/WebCore:

Test: platform/mac/accessibility/progressbar-indeterminate.html

* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
When getting min or max value of an indeterminate progress indicator, return 0.
This is so VoiceOver will recognize it as indeterminate.

LayoutTests:

* platform/mac/accessibility/progressbar-indeterminate-expected.txt: Added.
* platform/mac/accessibility/progressbar-indeterminate.html: Added.
Test that checks if 0 is returned for indetermiate progress indicators when
aria min and max values are non zero.

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

4 years agoUnreviewed, speculative iOS build fix after r182516.
cdumez@apple.com [Wed, 8 Apr 2015 05:44:28 +0000 (05:44 +0000)]
Unreviewed, speculative iOS build fix after r182516.

Add #if PLATFORM(MAC) checks.

* platform/spi/cg/CoreGraphicsSPI.h:

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

4 years agoTry to fix incremental builds by forcing *InternalSettings* to get
simon.fraser@apple.com [Wed, 8 Apr 2015 05:31:56 +0000 (05:31 +0000)]
Try to fix incremental builds by forcing *InternalSettings* to get
regenerated.

* testing/InternalSettings.idl:

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

4 years agoOpen WebSockets should not prevent a page from entering PageCache
cdumez@apple.com [Wed, 8 Apr 2015 04:24:24 +0000 (04:24 +0000)]
Open WebSockets should not prevent a page from entering PageCache
https://bugs.webkit.org/show_bug.cgi?id=143505
<rdar://problem/19923085>

Reviewed by Alexey Proskuryakov.

Source/WebCore:

Open WebSockets should not prevent a page from entering PageCache. This
is currently causing mobile.nytimes.com to not be page-cacheable.

In this patch, We close open WebSockets when entering the page cache
and fire the "close" events after resuming, similarly to what we did
for XMLHttpRequest in r181480. This gives a chance for the content to
handle the 'close' event (with wasClean being false and code being
1006) in order to reopen the connection if necessary.

Test: http/tests/websocket/tests/hybi/closed-when-entering-page-cache.html

* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::WebSocket):
(WebCore::WebSocket::canSuspend):
(WebCore::WebSocket::suspend):
(WebCore::WebSocket::resume):
(WebCore::WebSocket::resumeTimerFired):
(WebCore::WebSocket::didClose):
* Modules/websockets/WebSocket.h:

LayoutTests:

Add a layout test to check that an open WebSocket does not prevent a
page from entering page cache and that a 'close' event is fired after
resuming (restoring from the page cache).

* http/tests/websocket/tests/hybi/closed-when-entering-page-cache-expected.txt: Added.
* http/tests/websocket/tests/hybi/closed-when-entering-page-cache.html: Added.

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

4 years agoAdd experimental code to use custom font dilation when rendering into non-opaque...
simon.fraser@apple.com [Wed, 8 Apr 2015 04:15:01 +0000 (04:15 +0000)]
Add experimental code to use custom font dilation when rendering into non-opaque contexts
https://bugs.webkit.org/show_bug.cgi?id=143508

Reviewed by Sam Weinig.

Add GraphicsContext::setAntialiasedFontDilationEnabled(), and set it to true
when rendering into a compositing layer which is not opaque (at the same location
where we disable font smoothing).

If Settings::antialiasedFontDilationEnabled() is true, when rendering non-smoothed
text (and if CSS hasn't opted into antialiased mode), use custom font dilation
parameters, chosen using a light/medium/dark heuristic, to make this text
match more closely with LCD-smoothed text.

* page/Settings.cpp:
(WebCore::Settings::Settings):
(WebCore::Settings::setAntialiasedFontDilationEnabled): Set global state
in FontCascade (which can't easily get at Settings). This it not ideal,
but is temporary.
* page/Settings.h:
(WebCore::Settings::antialiasedFontDilationEnabled):
* page/Settings.in: Can't autogenerate this setting any more.
* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::setAntialiasedFontDilationEnabled): Set the global.
(WebCore::FontCascade::antialiasedFontDilationEnabled):
* platform/graphics/FontCascade.h:
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::setAntialiasedFontDilationEnabled): Set graphics state
to say that we should do dilation of antialiased text.
* platform/graphics/GraphicsContext.h:
(WebCore::GraphicsContextState::GraphicsContextState):
(WebCore::GraphicsContext::antialiasedFontDilationEnabled):
* platform/graphics/ca/mac/PlatformCALayerMac.mm:
(PlatformCALayer::drawLayerContents): If the layer is not opaque, enable the
dilated text code path.
* platform/graphics/cocoa/FontCascadeCocoa.mm:
(WebCore::dilationSizeForTextColor): Heuristic (values chosen empirically) to
computed custom dilation based on foreground color.
(WebCore::FontCascade::drawGlyphs): Set the custom dilation parameters, and the
antialiasing state if we're not doing smoothing, and CSS hasn't opted into the
antialiased path.
* platform/spi/cg/CoreGraphicsSPI.h: New SPI.

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

4 years agoPageVisibilityStateWithWindowChanges should only be enabled on Yosemite
ap@apple.com [Wed, 8 Apr 2015 03:40:36 +0000 (03:40 +0000)]
PageVisibilityStateWithWindowChanges should only be enabled on Yosemite
rdar://problem/20461342

* TestWebKitAPI/Tests/mac/PageVisibilityStateWithWindowChanges.mm:

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

4 years agoPerf dashboard should have a way of marking outliers
rniwa@webkit.org [Wed, 8 Apr 2015 03:39:27 +0000 (03:39 +0000)]
Perf dashboard should have a way of marking outliers
https://bugs.webkit.org/show_bug.cgi?id=143466

Reviewed by Chris Dumez.

Address kling's in-person comment to notify users when the new run status is saved in the database.

* public/v2/app.js:
(App.PaneController._selectedItemIsMarkedOutlierDidChange)
* public/v2/chart-pane.css: Fixed a typo.

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

4 years agoUnreviewed, rolling out r182511.
commit-queue@webkit.org [Wed, 8 Apr 2015 01:51:10 +0000 (01:51 +0000)]
Unreviewed, rolling out r182511.
https://bugs.webkit.org/show_bug.cgi?id=143507

caused debug test failures (Requested by alexchristensen on
#webkit).

Reverted changeset:

"Block popups from content extensions."
https://bugs.webkit.org/show_bug.cgi?id=143497
http://trac.webkit.org/changeset/182511

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

4 years ago[Cocoa] System fonts do not get correct tracking
mmaxfield@apple.com [Wed, 8 Apr 2015 01:08:15 +0000 (01:08 +0000)]
[Cocoa] System fonts do not get correct tracking
https://bugs.webkit.org/show_bug.cgi?id=143395

Reviewed by Ryosuke Niwa.

Inside FontPlatformData, we have two CTFonts. If the user has specified
-webkit-system-font, we will pass in a CTFont, and the FontPlatformData
will wrap it. However, we will then roundtrip through CGFont in order
to create a second CTFont. We were basing our tracking and system
font knowledge off of this round-tripped font instead of the original font.

Note that this design is terrible and needs to be overhauled.
FontPlatformData should only have a single platform font inside it.

This patch also caches whether or not a font is a system font.

No new tests because it is impossible to test the tracking of the
system font in a robust way.

* platform/graphics/Font.cpp:
(WebCore::Font::Font): Rearrange member variables.
* platform/graphics/Font.h: Move member variables around for better
packing, and cache whether or not the font is a system font.
* platform/graphics/FontData.h: Add comment
* platform/graphics/cocoa/FontCocoa.mm:
(WebCore::Font::platformInit): Cache whether or not the font is a system
font.
(WebCore::hasCustomTracking): Use cached value.
(WebCore::canUseFastGlyphAdvanceGetter):
(WebCore::Font::platformWidthForGlyph):

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

4 years agoBlock popups from content extensions.
commit-queue@webkit.org [Wed, 8 Apr 2015 00:38:11 +0000 (00:38 +0000)]
Block popups from content extensions.
https://bugs.webkit.org/show_bug.cgi?id=143497

Patch by Alex Christensen <achristensen@webkit.org> on 2015-04-07
Reviewed by Brady Eidson.

Source/WebCore:

Test: http/tests/contentextensions/popups.html

* loader/ResourceLoadInfo.cpp:
(WebCore::readResourceType):
* loader/ResourceLoadInfo.h:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::open):
* page/UserContentController.cpp:
(WebCore::UserContentController::actionsForResourceLoad):
* page/UserContentController.h:
Check content extensions before opening a window.

Tools:

* TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp:
(TestWebKitAPI::TEST_F):
Added popup test.

LayoutTests:

* http/tests/contentextensions/popups-expected.txt: Added.
* http/tests/contentextensions/popups.html: Added.
* http/tests/contentextensions/popups.html.json: Added.

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

4 years agoGet the features.json files ready for open contributions
benjamin@webkit.org [Tue, 7 Apr 2015 23:42:16 +0000 (23:42 +0000)]
Get the features.json files ready for open contributions
https://bugs.webkit.org/show_bug.cgi?id=143436

Reviewed by Darin Adler.

Source/JavaScriptCore:

* features.json:

Source/WebCore:

* features.json:

Tools:

* Scripts/webkitpy/style/checkers/jsonchecker.py:
(JSONFeaturesChecker.check):
Extend the syntax checking a bit, but leave everything non-mandatory
very loose until we figure what fields are important.

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

4 years agoMore unreviewed fixing API tests.
achristensen@apple.com [Tue, 7 Apr 2015 23:37:13 +0000 (23:37 +0000)]
More unreviewed fixing API tests.

* contentextensions/ContentExtensionsBackend.cpp:
(WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
Don't check for javascript protocol.

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

4 years ago[Mac] never update caption user style sheet during parsing
eric.carlson@apple.com [Tue, 7 Apr 2015 23:21:06 +0000 (23:21 +0000)]
[Mac] never update caption user style sheet during parsing
https://bugs.webkit.org/show_bug.cgi?id=143499

Reviewed by Jer Noble.

* page/CaptionUserPreferencesMediaAF.cpp:
(WebCore::CaptionUserPreferencesMediaAF::setInterestedInCaptionPreferenceChanges):
(WebCore::CaptionUserPreferencesMediaAF::captionPreferencesChanged):  Ignore a
    "preferences changed" notification fired while registering for said notification, we
    already create and insert the style sheet after a brief delay anyway.
* page/CaptionUserPreferencesMediaAF.h:

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

4 years ago[Win] Unreviewed build fix after r182494.
achristensen@apple.com [Tue, 7 Apr 2015 23:09:42 +0000 (23:09 +0000)]
[Win] Unreviewed build fix after r182494.

* platform/win/ContextMenuItemWin.cpp:
(WebCore::ContextMenuItem::ContextMenuItem): Deleted.

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

4 years agoFix the build.
timothy_horton@apple.com [Tue, 7 Apr 2015 22:56:29 +0000 (22:56 +0000)]
Fix the build.

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

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

4 years agoUnreviewed fixing API tests.
achristensen@apple.com [Tue, 7 Apr 2015 22:49:15 +0000 (22:49 +0000)]
Unreviewed fixing API tests.

* contentextensions/ContentExtensionsBackend.cpp:
(WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
* platform/URL.cpp:
(WebCore::URL::init):
* platform/URL.h:
(WebCore::URL::protocolIsData):
(WebCore::URL::protocolIsJavaScript): Deleted.
Revert part of r182492 that changed URL.h.

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

4 years agoExpose and test fixedLayoutSize via modern WebKit SPI
timothy_horton@apple.com [Tue, 7 Apr 2015 22:37:11 +0000 (22:37 +0000)]
Expose and test fixedLayoutSize via modern WebKit SPI
https://bugs.webkit.org/show_bug.cgi?id=143500

Reviewed by Simon Fraser.

* UIProcess/API/Cocoa/WKViewPrivate.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _isFixedLayoutEnabled]):
(-[WKWebView _setFixedLayoutEnabled:]):
(-[WKWebView _fixedLayoutSize]):
(-[WKWebView _setFixedLayoutSize:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/mac/WKView.mm:
(-[WKView _isFixedLayoutEnabled]):
(-[WKView _setFixedLayoutEnabled:]):
(-[WKView _fixedLayoutSize]):
(-[WKView _setFixedLayoutSize:]):
Add API for adjusting the fixed layout size, and whether or not we use it.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
Repair a mistake I made in r139822, where I brought odd TILED_BACKING_STORE-only
logic (which disables scrollbars if fixedLayoutSize is enabled) to the rest of the ports.
Put it back as TILED_BACKING_STORE-only.

Persist the fixedLayoutSize through view creation; we already persist the enabled state,
but not the size, which doesn't make any sense.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::fixedLayoutSize):
* WebProcess/WebPage/WebPage.h:
Add a fixedLayoutSize() getter.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/FixedLayoutSize.mm: Added.
(-[FixedLayoutSizeNavigationDelegate webView:didFinishNavigation:]):
(TEST):
Add a test that verifies that fixedLayoutSize works at all, that
it persists through a navigation, and that turning it back off reverts to
laying out at the size of the view.

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

4 years agoConstant folding of typed array properties should be handled by AI rather than streng...
fpizlo@apple.com [Tue, 7 Apr 2015 22:09:15 +0000 (22:09 +0000)]
Constant folding of typed array properties should be handled by AI rather than strength reduction
https://bugs.webkit.org/show_bug.cgi?id=143496

Reviewed by Geoffrey Garen.

Handling constant folding in AI is better because it precludes us from having to fixpoint the CFA
phase and whatever other phase did the folding in order to find all constants.

This also removes the TypedArrayWatchpoint node type because we can just set the watchpoint
directly.

This also fixes a bug in FTL lowering of GetTypedArrayByteOffset. The bug was previously not
found because all of the tests for it involved the property getting constant folded. I found that
the codegen was bad because an earlier version of the patch broke that constant folding. This
adds a new test for that node type, which makes constant folding impossible by allocating a new
typed array every type. The lesson here is: if you write a test for something, run the test with
full IR dumps to make sure it's actually testing the thing you want it to test.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGConstantFoldingPhase.cpp:
(JSC::DFG::ConstantFoldingPhase::foldConstants):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::dump):
(JSC::DFG::Graph::tryGetFoldableView):
(JSC::DFG::Graph::tryGetFoldableViewForChild1): Deleted.
* dfg/DFGGraph.h:
* dfg/DFGNode.h:
(JSC::DFG::Node::hasTypedArray): Deleted.
(JSC::DFG::Node::typedArray): Deleted.
* dfg/DFGNodeType.h:
* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::propagate):
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::jumpForTypedArrayOutOfBounds):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGStrengthReductionPhase.cpp:
(JSC::DFG::StrengthReductionPhase::handleNode):
(JSC::DFG::StrengthReductionPhase::foldTypedArrayPropertyToConstant): Deleted.
(JSC::DFG::StrengthReductionPhase::prepareToFoldTypedArray): Deleted.
* dfg/DFGWatchpointCollectionPhase.cpp:
(JSC::DFG::WatchpointCollectionPhase::handle):
(JSC::DFG::WatchpointCollectionPhase::addLazily):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::compileNode):
(JSC::FTL::LowerDFGToLLVM::compileGetTypedArrayByteOffset):
(JSC::FTL::LowerDFGToLLVM::typedArrayLength):
* tests/stress/fold-typed-array-properties.js:
(foo):
* tests/stress/typed-array-byte-offset.js: Added.
(foo):

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

4 years agoMore work on making the application cache storage be per page
andersca@apple.com [Tue, 7 Apr 2015 21:42:38 +0000 (21:42 +0000)]
More work on making the application cache storage be per page
https://bugs.webkit.org/show_bug.cgi?id=143498

Reviewed by Andreas Kling.

* loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::ApplicationCacheStorage::create):
(WebCore::ApplicationCacheStorage::singleton):
* loader/appcache/ApplicationCacheStorage.h:
* page/Page.cpp:
(WebCore::Page::Page):
* page/Page.h:
(WebCore::Page::applicationCacheStorage):
* page/PageConfiguration.cpp:
(WebCore::PageConfiguration::PageConfiguration): Deleted.
* page/PageConfiguration.h:

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

4 years agoPerf dashboard should have a way of marking outliers
rniwa@webkit.org [Tue, 7 Apr 2015 21:42:37 +0000 (21:42 +0000)]
Perf dashboard should have a way of marking outliers
https://bugs.webkit.org/show_bug.cgi?id=143466

Reviewed by Chris Dumez.

Added UI to mark a data point as an outlier as well as a button to toggle the visibility of outliers.
Added a new privileged API /privileged-api/update-run-status to store this boolean flag.

* init-database.sql: Added run_marked_outlier column to test_runs table.

* public/admin/tests.php:

* public/api/runs.php:
(main): Only emit Cache-Control and Expires headers in v1 UI.
(RunsGenerator::format_run): Emit markedOutlier.

* public/include/admin-header.php:

* public/include/db.php:
(Database::is_true): Made it static.

* public/include/manifest.php:
(Manifest::platforms):

* public/index.html: Call into /api/runs/ with ?cache=true.

* public/privileged-api/update-run-status.php: Added.
(main): Updates the newly added column in test_runs table.

* public/v2/app.js:
(App.Pane._fetch):
(App.Pane.refetchRuns): Extracted from App.Pane._fetch.
(App.Pane._didFetchRuns): Renamed from _updateChartData.
(App.Pane._setNewChartData): Added. Pick the right time series based based on the value of showOutlier.
Cloning chartData is necessary when toggling the outlier visibility or using statistics tools because
the interactive chart component only observes changes to chartData and not individual properties of it.
(App.Pane._highlightPointsMarkedAsOutlier): Added. Highlight points marked as outliers.
(App.Pane._movingAverageOrEnvelopeStrategyDidChange): Call to _setNewChartData replaced the code to
clone chartData here.

(App.PaneController.actions.toggleShowOutlier): Toggle the visibility of points marked as outliers by
invoking App.Pane._setNewChartData.
(App.PaneController._detailsChanged): Don't hide the analysis pane when details changed since keep
opening the pane for marking points as outliers would be annoying.
(App.PaneController._updateCanAnalyze): Update 'cannotMarkOutlier' as well as 'cannotAnalyze'.
(App.PaneController.selectedMeasurement): Added.
(App.PaneController.showOutlierTitle): Added.
(App.PaneController._selectedItemIsMarkedOutlierDidChange): Added. Call out to setMarkedOutlier to
mark the selected point as an outlier via the newly added privileged API.

* public/v2/chart-pane.css: Updated styles.

* public/v2/data.js:
(PrivilegedAPI._post): Report the semantic errors.
(Measurement.prototype.markedOutlier): Added.
(Measurement.prototype.setMarkedOutlier): Added. Uses PrivilegedAPI to update the database.
(RunsData.prototype.timeSeriesByCommitTime): Added a new argument, includeOutliers, to indicate
whether the time series should include measurements marked as outliers or not.
(RunsData.prototype.timeSeriesByBuildTime): Ditto.
(RunsData.prototype._timeSeriesByTimeInternal): Extracted from timeSeriesByCommitTime and
timeSeriesByBuildTime to share code. Now ignores measurements marked as outliers if needed.

* public/v2/index.html: Added an icon for showing and hiding outliers. Also added a checkbox to
mark individual points as outliers.

* public/v2/interactive-chart.js:
(App.InteractiveChartComponent._selectClosestPointToMouseAsCurrentItem): Re-enable the distance
heuristics that takes vertical closeness into account. This heuristics is more useful when marking
some points as outliers. This heuristics was disabled because the behavior was unpredictable but
with the arrow key navigation support, this is no longer an issue.

* public/v2/manifest.js:
(App.Manifest._formatFetchedData): Added showOutlier to the chart data. This function dynamically
updates the time series in this chart data in order to include or exclude outliers.

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

4 years agoSource and stack information should get appended only to native errors
mmirman@apple.com [Tue, 7 Apr 2015 21:34:05 +0000 (21:34 +0000)]
Source and stack information should get appended only to native errors
Source/JavaScriptCore:

and should be added directly after construction rather than when thrown.
This fixes frozen objects being unfrozen when thrown while conforming to
ecma script standard and other browser behavior.
rdar://problem/19927293
https://bugs.webkit.org/show_bug.cgi?id=141871

Reviewed by Geoffrey Garen.

Appending stack, source, line, and column information to an object whenever that object is thrown
is incorrect because it violates the ecma script standard for the behavior of throw.  Suppose for example
that the object being thrown already has one of these properties or is frozen.  Adding the properties
would then violate the frozen contract or overwrite those properties.  Other browsers do not do this,
and doing this causes unnecessary performance hits in code with heavy use of the throw construct as
a control flow construct rather than just an error reporting mechanism.

Because WebCore adds "native" errors which do not inherit from any JSC native error,
appending the error properties as a seperate call after construction of the error is required
to avoid having to manually truncate the stack and gather local source information due to
the stack being extended by a nested call to construct one of the native jsc error.

* interpreter/Interpreter.cpp:
(JSC::Interpreter::execute):
* interpreter/Interpreter.h:
* parser/ParserError.h:
(JSC::ParserError::toErrorObject):
* runtime/CommonIdentifiers.h:
* runtime/Error.cpp:
(JSC::createError):
(JSC::createEvalError):
(JSC::createRangeError):
(JSC::createReferenceError):
(JSC::createSyntaxError):
(JSC::createTypeError):
(JSC::createNotEnoughArgumentsError):
(JSC::createURIError):
(JSC::createOutOfMemoryError):
(JSC::FindFirstCallerFrameWithCodeblockFunctor::FindFirstCallerFrameWithCodeblockFunctor):
(JSC::FindFirstCallerFrameWithCodeblockFunctor::operator()):
(JSC::FindFirstCallerFrameWithCodeblockFunctor::foundCallFrame):
(JSC::FindFirstCallerFrameWithCodeblockFunctor::index):
(JSC::addErrorInfoAndGetBytecodeOffset):  Added.
(JSC::addErrorInfo): Added special case for appending complete error info
to a newly constructed error object.
* runtime/Error.h:
* runtime/ErrorConstructor.cpp:
(JSC::Interpreter::constructWithErrorConstructor):
(JSC::Interpreter::callErrorConstructor):
* runtime/ErrorInstance.cpp:
(JSC::appendSourceToError): Moved from VM.cpp
(JSC::FindFirstCallerFrameWithCodeblockFunctor::FindFirstCallerFrameWithCodeblockFunctor):
(JSC::FindFirstCallerFrameWithCodeblockFunctor::operator()):
(JSC::FindFirstCallerFrameWithCodeblockFunctor::foundCallFrame):
(JSC::FindFirstCallerFrameWithCodeblockFunctor::index):
(JSC::addErrorInfoAndGetBytecodeOffset):
(JSC::ErrorInstance::finishCreation):
* runtime/ErrorInstance.h:
(JSC::ErrorInstance::create):
* runtime/ErrorPrototype.cpp:
(JSC::ErrorPrototype::finishCreation):
* runtime/ExceptionFuzz.cpp:
(JSC::doExceptionFuzzing):
* runtime/ExceptionHelpers.cpp:
(JSC::createError):
(JSC::createInvalidFunctionApplyParameterError):
(JSC::createInvalidInParameterError):
(JSC::createInvalidInstanceofParameterError):
(JSC::createNotAConstructorError):
(JSC::createNotAFunctionError):
(JSC::createNotAnObjectError):
(JSC::throwOutOfMemoryError):
(JSC::createStackOverflowError): Deleted.
(JSC::createOutOfMemoryError): Deleted.
* runtime/ExceptionHelpers.h:
* runtime/JSArrayBufferConstructor.cpp:
(JSC::constructArrayBuffer):
* runtime/JSArrayBufferPrototype.cpp:
(JSC::arrayBufferProtoFuncSlice):
* runtime/JSGenericTypedArrayViewInlines.h:
(JSC::JSGenericTypedArrayView<Adaptor>::create):
(JSC::JSGenericTypedArrayView<Adaptor>::createUninitialized):
* runtime/NativeErrorConstructor.cpp:
(JSC::Interpreter::constructWithNativeErrorConstructor):
(JSC::Interpreter::callNativeErrorConstructor):
* runtime/VM.cpp:
(JSC::VM::throwException):
(JSC::appendSourceToError): Moved to Error.cpp
(JSC::FindFirstCallerFrameWithCodeblockFunctor::FindFirstCallerFrameWithCodeblockFunctor): Deleted.
(JSC::FindFirstCallerFrameWithCodeblockFunctor::operator()): Deleted.
(JSC::FindFirstCallerFrameWithCodeblockFunctor::foundCallFrame): Deleted.
(JSC::FindFirstCallerFrameWithCodeblockFunctor::index): Deleted.
* tests/stress/freeze_leek.js: Added.

Source/WebCore:

and should be added directly after construction rather than when thrown.
This fixes frozen objects being unfrozen when thrown while conforming to
ecma script standard and other browser behavior.
rdar://problem/19927293
https://bugs.webkit.org/show_bug.cgi?id=141871

Reviewed by Geoffrey Garen.

Covered by existing tests.

Sets line, column, source and stack information for DOMExceptions as
expected by the webinspector for native errors.

* bindings/js/JSDOMBinding.cpp:
(WebCore::setDOMException):

LayoutTests:

and should be added after construction rather than when thrown.
This fixes frozen objects being unfrozen when thrown while conforming to
ecma script standard and other browser behavior.
rdar://problem/19927293
https://bugs.webkit.org/show_bug.cgi?id=141871

Reviewed by Geoffrey Garen.

Fixes tests to throw new Errors such that they will contain line, column, and stack information
as expected, and fixes the column in the error in the expected output.

* http/tests/w3c/resources/testharness.js:  Other browsers don't expect stack information
with this test, but we do, and so the AssertionError should include stack information gathered from Error.
This could also have been fixed by changing expectations, but its a good idea to check the stack anyway.
* js/dom/exception-linenums-in-html-1.html: Throw "new Error()" rather than "{}".
* js/dom/exception-linenums-in-html-2.html: ditto.
* js/dom/exception-linenums-in-html-3.html: ditto.
* js/dom/script-tests/stack-trace.js: ditto.
(throwError): ditto.
(h): ditto.
(inlineableThrow): ditto.
(dfgThing.get willThrow): ditto.
(dfgThing.willThrowFunc): ditto.
* js/dom/stack-trace-expected.txt: fixed error column expectation.
* js/exception-properties-expected.txt: ditto.
* js/script-tests/exception-linenums.js:
(exceptionInFunction): throw "new Error()" rather than "{}".
(firstPropIsGetter.get getter): ditto
(secondPropIsGetter.get getter): ditto
(firstPropIsSetter.set setter): ditto
(secondPropIsSetter.set setter): ditto
* js/script-tests/exception-properties.js: now checking that column, line, and sourceURL are existant on a "new Error"
since we now add these at error construction rather than at error throwing.
* platform/mac/http/tests/media/media-source/mediasource-addsourcebuffer-expected.txt: fixed expectation to match.
* platform/mac/http/tests/media/media-source/mediasource-sourcebuffer-mode-expected.txt: ditto.

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

4 years agoContextMenuItem refactoring
beidson@apple.com [Tue, 7 Apr 2015 21:29:00 +0000 (21:29 +0000)]
ContextMenuItem refactoring
https://bugs.webkit.org/show_bug.cgi?id=143485

Reviewed by Beth Dakin.

Source/WebCore:

* platform/ContextMenuItem.h:
(WebCore::ContextMenuItem::isNull):

* platform/gtk/ContextMenuItemGtk.cpp:
(WebCore::ContextMenuItem::ContextMenuItem):

* platform/mac/ContextMenuItemMac.mm:
(WebCore::ContextMenuItem::ContextMenuItem):
(WebCore::ContextMenuItem::platformDescription):
(WebCore::ContextMenuItem::setSubMenu):
(WebCore::ContextMenuItem::releasePlatformDescription): Deleted.
(WebCore::ContextMenuItem::getPlatformDescription): Deleted.

* platform/mac/ContextMenuMac.mm:
(WebCore::ContextMenu::appendItem):
(WebCore::ContextMenu::insertItem):
(WebCore::platformMenuDescription):

* platform/win/ContextMenuItemWin.cpp:
(WebCore::ContextMenuItem::ContextMenuItem):

Source/WebKit/mac:

* WebCoreSupport/WebContextMenuClient.mm:
(WebContextMenuClient::contextMenuItemSelected):

Source/WebKit2:

* Shared/mac/NativeContextMenuItem.mm:
(WebKit::NativeContextMenuItem::NativeContextMenuItem):

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

4 years agoWeb Inspector: ES6: Show Symbol properties on Objects
joepeck@webkit.org [Tue, 7 Apr 2015 21:28:57 +0000 (21:28 +0000)]
Web Inspector: ES6: Show Symbol properties on Objects
https://bugs.webkit.org/show_bug.cgi?id=141279

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

* inspector/protocol/Runtime.json:
Give PropertyDescriptor a reference to the Symbol RemoteObject
if the property is a symbol property.

* inspector/InjectedScriptSource.js:
Enumerate symbol properties on objects.

Source/WebInspectorUI:

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Models/PropertyDescriptor.js:
(WebInspector.PropertyDescriptor.get symbol):

* UserInterface/Protocol/RemoteObject.js:
(WebInspector.RemoteObject.wrappedCallback):
Update new PropertyDescriptor call site.

* UserInterface/Views/ObjectTreeBaseTreeElement.js:
(WebInspector.ObjectTreeBaseTreeElement._logSymbolProperty):
Provide a context menu for rows with Symbol properties to log
the Symbol property, and therefore get a reference to it.

* UserInterface/Views/ObjectTreeView.js:
(WebInspector.ObjectTreeView.comparePropertyDescriptors):
Better handle symbol properties in sorting.

* UserInterface/Views/TypePropertiesSection.js:
(WebInspector.TypePropertiesSection.PropertyComparator):
Return better value when values are equal.

LayoutTests:

* inspector/model/remote-object-expected.txt:
* inspector/model/remote-object-get-properties-expected.txt:
* inspector/model/remote-object-get-properties.html:
* inspector/model/remote-object.html:
Update tests to include objects with Symbol properties.

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

4 years agoOptimize content extensions interpreting speed.
achristensen@apple.com [Tue, 7 Apr 2015 21:17:36 +0000 (21:17 +0000)]
Optimize content extensions interpreting speed.
https://bugs.webkit.org/show_bug.cgi?id=143490

Reviewed by Brady Eidson.

* contentextensions/ContentExtensionCompiler.cpp:
(WebCore::ContentExtensions::compileRuleList):
* contentextensions/ContentExtensionsBackend.cpp:
(WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
Measure total time added by content extensions.
* contentextensions/DFABytecodeCompiler.cpp:
(WebCore::ContentExtensions::DFABytecodeCompiler::compileNode):
(WebCore::ContentExtensions::DFABytecodeCompiler::compile):
When jumping to the root, don't re-add all the actions.
* contentextensions/DFABytecodeCompiler.h:
* platform/URL.cpp:
(WebCore::URL::init):
* platform/URL.h:
(WebCore::URL::protocolIsJavaScript): Added.

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

4 years agoAdd a new setting, AntialiasedFontDilationEnabled, exposed via WK2.
simon.fraser@apple.com [Tue, 7 Apr 2015 21:11:00 +0000 (21:11 +0000)]
Add a new setting, AntialiasedFontDilationEnabled, exposed via WK2.
https://bugs.webkit.org/show_bug.cgi?id=143495

Reviewed by Tim Horton.
Source/WebCore:

Add a new Setting, antialiasedFontDilationEnabled, which defaults to true. This
will be used in an upcoming patch.

* page/Settings.in:

Source/WebKit2:

Exposed the antialiasedFontDilationEnabled setting via WK C SPI and Objective-C SPI.

* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetAntialiasedFontDilationEnabled):
(WKPreferencesGetAntialiasedFontDilationEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _antialiasedFontDilationEnabled]):
(-[WKPreferences _setAntialiasedFontDilationEnabled:]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

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

4 years ago[Content Filtering] Add logging
aestes@apple.com [Tue, 7 Apr 2015 20:48:33 +0000 (20:48 +0000)]
[Content Filtering] Add logging
https://bugs.webkit.org/show_bug.cgi?id=143470

Reviewed by Daniel Bates.

Added a new ContentFiltering logging channel, and started logging some useful diagnostic messages.

* loader/ContentFilter.cpp:
(WebCore::ContentFilter::~ContentFilter):
(WebCore::ContentFilter::willSendRequest):
(WebCore::ContentFilter::startFilteringMainResource):
(WebCore::ContentFilter::responseReceived):
(WebCore::ContentFilter::dataReceived):
(WebCore::ContentFilter::notifyFinished):
(WebCore::ContentFilter::didDecide):
* platform/Logging.h:
* platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
(WebCore::ContentFilterUnblockHandler::canHandleRequest):
(WebCore::ContentFilterUnblockHandler::requestUnblockAsync):
* platform/cocoa/NetworkExtensionContentFilter.mm:
(WebCore::NetworkExtensionContentFilter::enabled):
(WebCore::NetworkExtensionContentFilter::unblockHandler):
(WebCore::NetworkExtensionContentFilter::handleDecision):
* platform/cocoa/ParentalControlsContentFilter.mm:
(WebCore::ParentalControlsContentFilter::enabled):
(WebCore::ParentalControlsContentFilter::updateFilterState):
* testing/MockContentFilter.cpp:
(WebCore::MockContentFilter::enabled):
(WebCore::MockContentFilter::unblockHandler):
(WebCore::MockContentFilter::maybeDetermineStatus):

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

4 years ago[Mac] video playing to external device should not be interrupted
eric.carlson@apple.com [Tue, 7 Apr 2015 20:23:17 +0000 (20:23 +0000)]
[Mac] video playing to external device should not be interrupted
https://bugs.webkit.org/show_bug.cgi?id=143492

Reviewed by Jer Noble.

* Modules/mediacontrols/mediaControlsApple.js:
(Controller.prototype.handlePanelTransitionEnd):  Drive-by fix to make sure the controls are
    not hidden if the opacity timer is primed before they go into a state where they should
    never be hidden.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::canPlayToWirelessPlaybackTarget): Make it const.
(WebCore::HTMLMediaElement::isPlayingToWirelessPlaybackTarget): New.
* html/HTMLMediaElement.h:

* html/HTMLMediaSession.cpp:
(WebCore::HTMLMediaSession::canPlayToWirelessPlaybackTarget): New. Short-circuit call to
    client when we already know the answer.
(WebCore::HTMLMediaSession::isPlayingToWirelessPlaybackTarget): Ditto.
(WebCore::HTMLMediaSession::startPlayingToPlaybackTarget): Ditto.
(WebCore::HTMLMediaSession::stopPlayingToPlaybackTarget): Ditto.
* html/HTMLMediaSession.h:

* platform/audio/MediaSession.cpp:
(WebCore::MediaSession::canPlayToWirelessPlaybackTarget): Deleted, moved inline and neutered
    because only HTMLMediaSession needs to use them.
(WebCore::MediaSession::startPlayingToPlaybackTarget): Ditto.
(WebCore::MediaSession::stopPlayingToPlaybackTarget): Ditto.
* platform/audio/MediaSession.h:
(WebCore::MediaSession::canPlayToWirelessPlaybackTarget):
(WebCore::MediaSession::isPlayingToWirelessPlaybackTarget):
(WebCore::MediaSession::startPlayingToPlaybackTarget):
(WebCore::MediaSession::stopPlayingToPlaybackTarget):
(WebCore::MediaSessionClient::canPlayToWirelessPlaybackTarget):
(WebCore::MediaSessionClient::isPlayingToWirelessPlaybackTarget):

* platform/audio/MediaSessionManager.cpp:
(WebCore::MediaSessionManager::MediaSessionManager):
(WebCore::MediaSessionManager::sessionShouldBeginPlayingToWirelessPlaybackTarget): New.
(WebCore::MediaSessionManager::sessionWillBeginPlayback): Don't interrupt an active session
    playing to a target device.
* platform/audio/MediaSessionManager.h:

* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::isPlayingToWirelessPlaybackTarget): New, passthrough.
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::isPlayingToWirelessPlaybackTarget):

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
(WebCore::MediaPlayerPrivateAVFoundationObjC::canPlayToWirelessPlaybackTarget):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget): Explicitly call
    when passed a nil or inactive target context.
(WebCore::MediaPlayerPrivateAVFoundationObjC::startPlayingToPlaybackTarget): Add logging.
(WebCore::MediaPlayerPrivateAVFoundationObjC::stopPlayingToPlaybackTarget): Ditto.
(WebCore::MediaPlayerPrivateAVFoundationObjC::isPlayingToWirelessPlaybackTarget): New. Return
    true when playing with an active context.
(WebCore::playerKVOProperties): "outputContext" is not observable.

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

4 years agoShould only propagate pressure events with relevant phases
bdakin@apple.com [Tue, 7 Apr 2015 20:14:20 +0000 (20:14 +0000)]
Should only propagate pressure events with relevant phases
https://bugs.webkit.org/show_bug.cgi?id=143494
-and corresponding-
rdar://problem/20453738

Reviewed by Tim Horton.

We only care about the changed, began, and ended phases.
* UIProcess/API/mac/WKView.mm:
(-[WKView pressureChangeWithEvent:]):

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

4 years agoUnreviewed. Add myself as a committer.
mcatanzaro@igalia.com [Tue, 7 Apr 2015 19:50:34 +0000 (19:50 +0000)]
Unreviewed. Add myself as a committer.

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

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

4 years agoMake it possible to enable LLVM FastISel
fpizlo@apple.com [Tue, 7 Apr 2015 19:41:12 +0000 (19:41 +0000)]
Make it possible to enable LLVM FastISel
https://bugs.webkit.org/show_bug.cgi?id=143489

Reviewed by Michael Saboff.

The decision to enable FastISel is made by Options.h|cpp, but the LLVM library can disable it if it finds that it is built
against a version of LLVM that doesn't support it. Thereafter, JSC::enableLLVMFastISel is the flag that tells the system
if we should enable it.

* ftl/FTLCompile.cpp:
(JSC::FTL::mmAllocateDataSection):
* llvm/InitializeLLVM.cpp:
(JSC::initializeLLVMImpl):
* llvm/InitializeLLVM.h:
* llvm/InitializeLLVMLinux.cpp:
(JSC::getLLVMInitializerFunction):
(JSC::initializeLLVMImpl): Deleted.
* llvm/InitializeLLVMMac.cpp:
(JSC::getLLVMInitializerFunction):
(JSC::initializeLLVMImpl): Deleted.
* llvm/InitializeLLVMPOSIX.cpp:
(JSC::getLLVMInitializerFunctionPOSIX):
(JSC::initializeLLVMPOSIX): Deleted.
* llvm/InitializeLLVMPOSIX.h:
* llvm/InitializeLLVMWin.cpp:
(JSC::getLLVMInitializerFunction):
(JSC::initializeLLVMImpl): Deleted.
* llvm/LLVMAPI.cpp:
* llvm/LLVMAPI.h:
* llvm/library/LLVMExports.cpp:
(initCommandLine):
(initializeAndGetJSCLLVMAPI):
* runtime/Options.cpp:
(JSC::Options::initialize):

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

4 years agoWeb Inspector: HierarchicalPathNavigationItem's additionalClassNames should be _addit...
timothy@apple.com [Tue, 7 Apr 2015 18:35:48 +0000 (18:35 +0000)]
Web Inspector: HierarchicalPathNavigationItem's additionalClassNames should be _additionalClassNames
https://bugs.webkit.org/show_bug.cgi?id=143487

Reviewed by Joseph Pecoraro.

* UserInterface/Views/HierarchicalPathNavigationItem.js:
(WebInspector.HierarchicalPathNavigationItem.prototype.get _additionalClassNames):

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

4 years ago[Win] Bots complain about missing /etc/catalog
bfulgham@apple.com [Tue, 7 Apr 2015 18:06:54 +0000 (18:06 +0000)]
[Win] Bots complain about missing /etc/catalog
https://bugs.webkit.org/show_bug.cgi?id=143484

Reviewed by Chris Dumez.

The libxml2 build on Mac, iOS, and Windows does not provide the set
of default catalog files. We do not actually need these for our
purposes, but we get warnings and some bot flakiness because they
are not present.

We can avoid both problems the same way the Mac and iOS ports do,
by setting the XML_CATALOG_FILES environment variable to 'empty string',
which avoid the warnings and bot problems.

* Scripts/webkitpy/port/win.py:
(WinPort.setup_environ_for_server): Added.

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

4 years agoRe-add JSReadableStream and JSReadableStreamReader the Xcode project to
weinig@apple.com [Tue, 7 Apr 2015 17:22:15 +0000 (17:22 +0000)]
Re-add JSReadableStream and JSReadableStreamReader the Xcode project to
make Xcode happy.

* WebCore.xcodeproj/project.pbxproj:

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

4 years agoUnreviewed build fix; make calls to new SPI conditional on iOS version.
jer.noble@apple.com [Tue, 7 Apr 2015 17:18:30 +0000 (17:18 +0000)]
Unreviewed build fix; make calls to new SPI conditional on iOS version.

* UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
(WebKit::WebVideoFullscreenManagerProxy::setVideoLayerFrame):

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

4 years agoUse content extensions in MiniBrowser.
achristensen@apple.com [Tue, 7 Apr 2015 17:07:22 +0000 (17:07 +0000)]
Use content extensions in MiniBrowser.
https://bugs.webkit.org/show_bug.cgi?id=143446

Patch by Sam Weinig <sam@webkit.org> on 2015-04-06
Reviewed by Alex Christensen.

* MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj:
* MiniBrowser/mac/AppDelegate.h:
* MiniBrowser/mac/AppDelegate.m:
(-[BrowserAppDelegate init]):
(-[BrowserAppDelegate showExtensionsManager:]):
(-[BrowserAppDelegate userContentContoller]):
* MiniBrowser/mac/ExtensionManagerWindowController.h: Added.
* MiniBrowser/mac/ExtensionManagerWindowController.m: Added.
(-[ExtensionManagerWindowController init]):
(-[ExtensionManagerWindowController windowDidLoad]):
(-[ExtensionManagerWindowController add:]):
(-[ExtensionManagerWindowController remove:]):
* MiniBrowser/mac/ExtensionManagerWindowController.xib: Added.
* MiniBrowser/mac/MainMenu.xib:

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

4 years ago[CSS Grid Layout] Update track sizes after distributing extra space
svillar@igalia.com [Tue, 7 Apr 2015 14:53:34 +0000 (14:53 +0000)]
[CSS Grid Layout] Update track sizes after distributing extra space
https://bugs.webkit.org/show_bug.cgi?id=141422

Reviewed by Antti Koivisto.

Source/WebCore:

Both old and new tracks sizing algorithms instruct us to update
the sizes of the content sized tracks only after distributing the
extra space for all the items in the same span group. So far we
were doing it inside distributeSpaceToTracks(), i.e., once for
every single item. That is wrong because it makes the algorithm
order dependent.

Our old implementation looked something like this (pseudocode):

resolveContentBasedTrackSizingFunctions()
  foreach item
    resolveContentBasedTrackSizingFunctionsForItems() (x4)
      distributeSpaceToTracks()
        updateTrackSizes()

Now it's done this way (pseudocode):

resolveContentBasedTrackSizingFunctions()
  foreach spanGroup
    resolveContentBasedTrackSizingFunctionsForItems() (x4)
      foreach item in spanGroup
        distributeSpaceToTracks()
      updateTrackSizes()

As it can be seen the update of track sizes only happens after
processing all the items of a given span group. In order to
accomplish this a new field was added to GridTrack called
tempIncrease which stores per-track increases while distributing
the extra space among the items in the same span group. That
temporal increase could eventually be used to update the
plannedIncrease which is the one we use to finally set the new
size of the track.

This change makes our implementation closer to the spec, removes
the order dependency and ensures that every track satisfies their
min track sizing functions before starting to consider the max
track sizing functions.

Test: fast/css-grid-layout/grid-update-sizes-after-distributing-all.html

* rendering/RenderGrid.cpp:
(WebCore::GridTrack::plannedSize):
(WebCore::GridTrack::setPlannedSize): New setter.
(WebCore::GridTrack::tempSize): New attribute.
(WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
RenderGrid::distributeSpaceToTracks() no longer updates the track
sizes so we have to do it after the call returns.
(WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
Call RenderGrid::resolveContentBasedTrackSizingFunctionsForItems()
passing a span group instead of a single item.
(WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
It now receives a span group instead of a single item. Apart from
that we need an extra function to get the unaltered track size (as
the current one returns the base size whenever the growth limit is
infinity).
(WebCore::RenderGrid::distributeSpaceToTracks): This no longer
updates track sizes but only the track's planned size;
* rendering/RenderGrid.h:

LayoutTests:

* fast/css-grid-layout/grid-content-sized-columns-resolution-expected.txt:
* fast/css-grid-layout/grid-content-sized-columns-resolution.html:
* fast/css-grid-layout/grid-update-sizes-after-distributing-all-expected.txt: Added.
* fast/css-grid-layout/grid-update-sizes-after-distributing-all.html: Added.

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

4 years ago[GTK] Gardening 7th April
commit-queue@webkit.org [Tue, 7 Apr 2015 12:57:10 +0000 (12:57 +0000)]
[GTK] Gardening 7th April
https://bugs.webkit.org/show_bug.cgi?id=143467

Unreviewed

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

* platform/gtk/TestExpectations:
* platform/gtk/editing/deleting/regional-indicators-expected.txt: Rebaselined after r182137.
* platform/gtk/editing/pasteboard/emacs-ctrl-k-y-001-expected.txt: Rebaselined after r181889.
* platform/gtk/inspector-protocol/debugger/regress-133182-expected.txt: Added. Rebaselined after r181810.

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

4 years agoweb-platform-tests server should retrieve the modules file relatively to its docroot...
youenn.fablet@crf.canon.fr [Tue, 7 Apr 2015 08:11:06 +0000 (08:11 +0000)]
web-platform-tests server should retrieve the modules file relatively to its docroot path
https://bugs.webkit.org/show_bug.cgi?id=142742

Reviewed by Darin Adler.

* Scripts/webkitpy/layout_tests/servers/web_platform_test_server.py:
(WebPlatformTestServer._install_modules): Compute the modules description file path according wpt server doc root path.

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

4 years agoput_by_val_direct need to check the property is index or not for using putDirect...
utatane.tea@gmail.com [Tue, 7 Apr 2015 07:26:08 +0000 (07:26 +0000)]
put_by_val_direct need to check the property is index or not for using putDirect / putDirectIndex
https://bugs.webkit.org/show_bug.cgi?id=140426

Reviewed by Darin Adler.

In the put_by_val_direct operation, we use JSObject::putDirect.
However, it only accepts non-index property. For index property, we need to use JSObject::putDirectIndex.
This patch checks toString-ed Identifier is index or not to choose putDirect / putDirectIndex.

* dfg/DFGOperations.cpp:
(JSC::DFG::putByVal):
(JSC::DFG::operationPutByValInternal):
* jit/JITOperations.cpp:
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* runtime/Identifier.h:
(JSC::isIndex):
(JSC::parseIndex):
* tests/stress/dfg-put-by-val-direct-with-edge-numbers.js: Added.
(lookupWithKey):
(toStringThrowsError.toString):

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

4 years ago[GTK] Fix HPPA build
berto@igalia.com [Tue, 7 Apr 2015 06:25:10 +0000 (06:25 +0000)]
[GTK] Fix HPPA build
https://bugs.webkit.org/show_bug.cgi?id=143453

Reviewed by Darin Adler.

Add HPPA to the list of supported CPUs.

* CMakeLists.txt:

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

4 years agoBing video search result pages are not PageCacheable
cdumez@apple.com [Tue, 7 Apr 2015 06:22:59 +0000 (06:22 +0000)]
Bing video search result pages are not PageCacheable
https://bugs.webkit.org/show_bug.cgi?id=143463
<rdar://problem/20440916>

Reviewed by Alexey Proskuryakov.

Source/WebCore:

Bing video search result pages are not PageCacheable (tested on iOS).
It both:
- is bad for power usage as it causes a reload when clicking one of the
  results then navigating back in history.
- degrades user experience because the results page uses infinite
  scrolling and the scroll position is not properly restored when
  navigating back, not to mention the user has to wait for the reload
  to complete.

The issue was that the bing search page was doing a ping load when
clicking on one of the search results. The ping load was done by
create an image and its 'src' attribute to the ping URL. This load
usually did not have time to complete when navigating away so we would
cancel it and the main document would end up with an error that would
prevent the page from entering the page cache. We already have code
making sure load cancellations do not prevent page caching as long as
the loads are for XHR or images. However, the latter check was broken
in the case where the ResourceRequest's cachePartition was non-empty.
This is because the check was using the MemoryCache::ResourceForUrl()
API which rarely does what we want because it will request a dummy
ResourceRequest (without cachePartition) and then call
MemoryCache::resourceForRequest(). This patch updates the check
to use resourceForRequest() directly as we have the ResourceRequest
at this point.

This patch also gets rid of the  MemoryCache::ResourceForUrl() API as
it rarely does what we want and it is bug prone. It was only used in
2 places, one of them causing this bug and the other in Internals.

Tests: http/tests/navigation/page-cache-pending-image-load-cache-partition.html
       http/tests/navigation/page-cache-pending-image-load.html

* loader/DocumentLoader.cpp:
(WebCore::areAllLoadersPageCacheAcceptable):
Use MemoryCache::resourceForRequest() instead of resourceForUrl() as
we have the ResourceRequest and calling resourceForUrl() would loose
the cachePartition.

* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::resourceForURL): Deleted.
Drop this API as it is bug prone and rarely does what we want.

* testing/Internals.cpp:
(WebCore::Internals::isLoadingFromMemoryCache):
Update call to create a dummy ResourceRequest and call
resourceForRequest() instead of resourceForUrl(), as this API no
longer exists. The new code also set the cachePartition on the
dummy request so that this function actually behaves as expected
if the cachePartition in the memory cache is non-empty.

Source/WebKit/mac:

Fix the iOS / WK1 build by using MemoryCache::resourceForRequest()
instead of resourceForUrl().

* Misc/WebCache.mm:
(+[WebCache imageForURL:]):

LayoutTests:

Add layout tests to confirm that a pending image load does not prevent
a page from entering the page cache. There are 2 tests, once that cover
the case where the request's cachePartion is empty (passing without the
fix), and another where the request's cachePartition is non-empty
(which only passes with the fix).

* http/tests/navigation/page-cache-pending-image-load-cache-partition-expected.txt: Added.
* http/tests/navigation/page-cache-pending-image-load-cache-partition.html: Added.
* http/tests/navigation/page-cache-pending-image-load-expected.txt: Added.
* http/tests/navigation/page-cache-pending-image-load.html: Added.

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

4 years agohttp/tests/contentfiltering/block-after-redirect.html fails on Windows
aestes@apple.com [Tue, 7 Apr 2015 00:29:39 +0000 (00:29 +0000)]
http/tests/contentfiltering/block-after-redirect.html fails on Windows
https://bugs.webkit.org/show_bug.cgi?id=143460

* platform/win/TestExpectations: Marked test as ImageOnlyFailure.

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

4 years agoCreate the web inspector process pool lazily
andersca@apple.com [Tue, 7 Apr 2015 00:05:28 +0000 (00:05 +0000)]
Create the web inspector process pool lazily
https://bugs.webkit.org/show_bug.cgi?id=143456
rdar://problem/20146520

Reviewed by Mark Lam.

Add and implement WebInspectorProxy::isInspectorProcessPool instead of always creating the inspector process pool
when trying to determine if a given process pool is the inspector process pool.

This should speed up initialization somewhat and avoid creating a storage manager for example.

* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::inspectorProcessPool):
(WebKit::WebInspectorProxy::isInspectorProcessPool):
* UIProcess/WebInspectorProxy.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::getLaunchOptions):

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

4 years agoUnreviewed, rolling out r182445.
achristensen@apple.com [Mon, 6 Apr 2015 23:24:58 +0000 (23:24 +0000)]
Unreviewed, rolling out r182445.
https://bugs.webkit.org/show_bug.cgi?id=143459

broke 32 bit build (Requested by alexchristensen on #webkit).

Reverted changeset:

"Use content extensions in MiniBrowser."
https://bugs.webkit.org/show_bug.cgi?id=143446
http://trac.webkit.org/changeset/182445

Patch by Commit Queue <commit-queue@webkit.org> on 2015-04-06

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

4 years agoUse content extensions in MiniBrowser.
achristensen@apple.com [Mon, 6 Apr 2015 23:15:49 +0000 (23:15 +0000)]
Use content extensions in MiniBrowser.
https://bugs.webkit.org/show_bug.cgi?id=143446

Patch by Sam Weinig <sam@webkit.org> on 2015-04-06
Reviewed by Alex Christensen.

* MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj:
* MiniBrowser/mac/AppDelegate.h:
* MiniBrowser/mac/AppDelegate.m:
(-[BrowserAppDelegate init]):
(-[BrowserAppDelegate showExtensionsManager:]):
(-[BrowserAppDelegate userContentContoller]):
* MiniBrowser/mac/ExtensionManagerWindowController.h: Added.
* MiniBrowser/mac/ExtensionManagerWindowController.m: Added.
(-[ExtensionManagerWindowController init]):
(-[ExtensionManagerWindowController windowDidLoad]):
(-[ExtensionManagerWindowController add:]):
(-[ExtensionManagerWindowController remove:]):
* MiniBrowser/mac/ExtensionManagerWindowController.xib: Added.
* MiniBrowser/mac/MainMenu.xib:

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

4 years agoIn the 64-bit DFG and FTL, Array::Double case for HasIndexedProperty should set its...
mark.lam@apple.com [Mon, 6 Apr 2015 22:48:00 +0000 (22:48 +0000)]
In the 64-bit DFG and FTL, Array::Double case for HasIndexedProperty should set its result to true when all is well.
<https://webkit.org/b/143396>

Reviewed by Filip Pizlo.

The DFG was neglecting to set the result boolean.  The FTL was setting it with
an inverted value.  Both of these are now resolved.

* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::compileHasIndexedProperty):
* tests/stress/for-in-array-mode.js: Added.
(.):
(test):

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

4 years ago[Win] [SVG -> OTF Converter] Turn off on Windows until I can get the tests under...
mmaxfield@apple.com [Mon, 6 Apr 2015 22:39:07 +0000 (22:39 +0000)]
[Win] [SVG -> OTF Converter] Turn off on Windows until I can get the tests under control

Unreviewed.

* win/tools/vsprops/FeatureDefines.props:

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

4 years agoCombine ActionMenuHitTestResult with WebHitTestResult
beidson@apple.com [Mon, 6 Apr 2015 22:33:57 +0000 (22:33 +0000)]
Combine ActionMenuHitTestResult with WebHitTestResult
https://bugs.webkit.org/show_bug.cgi?id=143444

Reviewed by Beth Dakin.

* Shared/mac/ActionMenuHitTestResult.h: Removed.
* Shared/mac/ActionMenuHitTestResult.mm: Removed.

* Shared/WebHitTestResult.cpp:
(WebKit::WebHitTestResult::Data::Data):
(WebKit::WebHitTestResult::Data::encode):
(WebKit::WebHitTestResult::Data::decode):
(WebKit::WebHitTestResult::Data::platformEncode):
(WebKit::WebHitTestResult::Data::platformDecode):
* Shared/WebHitTestResult.h:
* Shared/mac/WebHitTestResult.mm: Added.
(WebKit::WebHitTestResult::Data::platformEncode):
(WebKit::WebHitTestResult::Data::platformDecode):

* UIProcess/API/mac/WKView.mm:
(-[WKView _didPerformActionMenuHitTest:forImmediateAction:contentPreventsDefault:userData:]):
(-[WKView _didPerformActionMenuHitTest:forImmediateAction:userData:]): Deleted.
* UIProcess/API/mac/WKViewInternal.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didPerformActionMenuHitTest):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::didPerformActionMenuHitTest):
* UIProcess/mac/WKActionMenuController.h:
* UIProcess/mac/WKActionMenuController.mm:
(-[WKActionMenuController willDestroyView:]):
(-[WKActionMenuController _clearActionMenuState]):
(-[WKActionMenuController didPerformActionMenuHitTest:userData:]):
(-[WKActionMenuController _hitTestResultDataImage]):
(-[WKActionMenuController _defaultMenuItemsForImage]):
(-[WKActionMenuController _copyImage:]):
(-[WKActionMenuController _addImageToPhotos:]):
(-[WKActionMenuController _defaultMenuItemsForDataDetectedText]):
(-[WKActionMenuController _defaultMenuItemsForEditableTextWithSuggestions]):
(-[WKActionMenuController _defaultMenuItemsForDataDetectableLink]):
(-[WKActionMenuController _webHitTestResult]):
(-[WKActionMenuController _defaultMenuItems]):
(-[WKActionMenuController _hitTestResultImage]): Deleted.
* UIProcess/mac/WKImmediateActionController.h:
* UIProcess/mac/WKImmediateActionController.mm:
(-[WKImmediateActionController willDestroyView:]):
(-[WKImmediateActionController _clearImmediateActionState]):
(-[WKImmediateActionController didPerformActionMenuHitTest:contentPreventsDefault:userData:]):
(-[WKImmediateActionController immediateActionRecognizerDidUpdateAnimation:]):
(-[WKImmediateActionController _webHitTestResult]):
(-[WKImmediateActionController _defaultAnimationController]):
(-[WKImmediateActionController _updateImmediateActionItem]):
(-[WKImmediateActionController _menuItemForDataDetectedText]):
(-[WKImmediateActionController _animationControllerForText]):
(-[WKImmediateActionController didPerformActionMenuHitTest:userData:]): Deleted.
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::performActionMenuHitTestAtLocation):

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

4 years ago[GTK] install-dependencies should prefer dnf to yum
commit-queue@webkit.org [Mon, 6 Apr 2015 22:27:09 +0000 (22:27 +0000)]
[GTK] install-dependencies should prefer dnf to yum
https://bugs.webkit.org/show_bug.cgi?id=143441

Patch by Michael Catanzaro <mcatanzaro@gnome.org> on 2015-04-06
Reviewed by Martin Robinson.

Test for the existance of dnf before yum, and only try to use yum if dnf does not exist.

* gtk/install-dependencies:

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

4 years ago[iOS] 'make clean' fails in Tools/WebKitTestRunner
aestes@apple.com [Mon, 6 Apr 2015 22:16:30 +0000 (22:16 +0000)]
[iOS] 'make clean' fails in Tools/WebKitTestRunner
https://bugs.webkit.org/show_bug.cgi?id=143455

Reviewed by Dan Bernstein.

This Makefile adds '-target WebKitTestRunnerApp' to OTHER_OPTIONS during iOS builds, but the top-level
Makefile.shared adds '-alltargets' for clean builds, and xcodebuild does not allow both -target and -alltargets.

* WebKitTestRunner/Makefile: Don't add '-target WebKitTestRunerApp' to OTHER_OPTIONS on clean builds.

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

4 years agoSynchronize fullscreen animation between processes.
jer.noble@apple.com [Mon, 6 Apr 2015 22:02:46 +0000 (22:02 +0000)]
Synchronize fullscreen animation between processes.
https://bugs.webkit.org/show_bug.cgi?id=143131

Reviewed by Simon Fraser.

Source/WebCore:

Rather than attempt to synchcronize animations across the WebProcess / UIProcess boundary,
do the bounds-change animation in-process by applying a sublayer transformation to the
video layer. This gives the same visual effect as a synchronized bounds animation, but
without needing a synchronization fence. Resolve the difference between the transformation
and bounds by doing a fence-synchronized bounds change after the current animation is
scheduled to complete.

To do this calculation correctly, WebAVPlayer needs to query both the effective
videoLayerFrame and the videoLayerGravity. To that end, add getter methods for
videoLayerFrame() and videoLayerGravity().

* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::videoFullscreenGravity):
* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(-[WebAVVideoLayer dealloc]): Cancel outstanding performSelector requests.
(-[WebAVVideoLayer setBounds:]): Add a scale transform to simulate a bonuds change.
(-[WebAVVideoLayer resolveBounds]): Reset the scale transform and set the bounds.
(WebVideoFullscreenInterfaceAVKit::setupFullscreenInternal): Set the initial video frame bounds.
(-[WebAVPlayerController layoutSublayersOfLayer:]): Deleted.
* platform/ios/WebVideoFullscreenModel.h:
* platform/ios/WebVideoFullscreenModelVideoElement.h:
* platform/ios/WebVideoFullscreenModelVideoElement.mm:
(WebVideoFullscreenModelVideoElement::videoLayerFrame): Added; simple getter.
(WebVideoFullscreenModelVideoElement::videoLayerGravity): Ditto.

Source/WebKit2:

Support synchronize resizing by animating within the UIProcess. Since setVideoLayerFrameFenced() is now only
ever called from within a 0-duration transaction, make that the official contract of the function and wrap
the WebProcess side of that method in its own 0-duration transaction.

* Platform/spi/ios/BackBoardServicesSPI.h: Added.
* Platform/spi/ios/UIKitSPI.h:
* UIProcess/ios/WebVideoFullscreenManagerProxy.h:
* UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
(WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID): Remember the initial rect.
(WebKit::WebVideoFullscreenManagerProxy::videoLayerFrame): Added; simple getter.
(WebKit::WebVideoFullscreenManagerProxy::setVideoLayerFrame): Use a different synchronization fence primative.
    Save the cached frame value.
(WebKit::WebVideoFullscreenManagerProxy::videoLayerGravity): Added; simple getter.
(WebKit::WebVideoFullscreenManagerProxy::setVideoLayerGravity): Save the cached gravity value.
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/ios/WebVideoFullscreenManager.mm:
(WebKit::WebVideoFullscreenManager::setVideoLayerFrameFenced): Wrap in a 0-length transaction.

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

4 years agoPerf dashboard should be able to trigger A/B testing jobs for iOS
rniwa@webkit.org [Mon, 6 Apr 2015 21:08:26 +0000 (21:08 +0000)]
Perf dashboard should be able to trigger A/B testing jobs for iOS
https://bugs.webkit.org/show_bug.cgi?id=143398

Reviewed by Chris Dumez.

Fix various bugs in the perf dashboard so that it can schedule A/B testing jobs for iOS.

Also generalized sync-with-buildbot.py slightly to meet the requirements of iOS builders.

* public/api/triggerables.php:
(main): Avoid spitting a warning when $id_to_triggerable doesn't contain the triggerable.
* public/v2/analysis.js:
(App.AnalysisTask.triggerable): Log an error when failed to fetch triggerables for debugging purposes.
* public/v2/app.js:
(App.AnalysisTaskController.updateRootConfigurations): Show 'None' when a revision is missing from
some of the data points. This will happen when we modify the list of projects we build for iOS.
(App.AnalysisTaskController.actions.createTestGroup): Gracefully fail by showing alerts when an user
attempts to create an invalid test group; when there is already another test group of the same or when
only either configuration specifies the revision for some repository.
(App.AnalysisTaskController._updateRootsBySelectedPoints): Fixed a typo: sets[i] -> set.
* public/v2/index.html: Don't show the form to create a new test group if it's not available.
* tools/sync-with-buildbot.py:
(find_request_updates):
(schedule_request): iOS builders take a JSON that contains the list of roots. Generate this JSON when
a dictionary of the form {rootsExcluding: ["WebKit"]} is specified. Also replaced the way we refer to
a revision from $-based text replacements to an explicit dictionary of the form {root: "WebKit"}.
(request_id_from_build): Don't hard code the parameter name here. Retrieve the name from the config.

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

4 years ago[WK2][iOS] Regression(r182323): ASSERTION FAILED: WebCore::SQLiteDatabaseTracker...
cdumez@apple.com [Mon, 6 Apr 2015 20:49:40 +0000 (20:49 +0000)]
[WK2][iOS] Regression(r182323): ASSERTION FAILED: WebCore::SQLiteDatabaseTracker::hasTransactionInProgress() in NetworkCache::Statistics::initialize()
https://bugs.webkit.org/show_bug.cgi?id=143451
<rdar://problem/20437994>

Reviewed by Anders Carlsson.

Initialize WebProcess::m_webSQLiteDatabaseTracker and
NetworkProcess::m_webSQLiteDatabaseTracker in their respective class
constructors instead of doing it later in the initializeWebProcess() /
initializeNetworkProcess() methods.

If we do it later, it can happen that the tracker gets set after
a SQLiteTransactionInProgressAutoCounter initialization and before
the actual transaction. When this happens, the
SQLiteTransactionInProgressAutoCounter variable fails to increment the
transaction count. Then when the transaction is executed,
SQLiteDatabaseTracker::hasTransactionInProgress() can return false.
This would lead to possible assertions on start up on iOS.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::NetworkProcess):
(WebKit::NetworkProcess::initializeNetworkProcess):
* NetworkProcess/NetworkProcess.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::WebProcess):
(WebKit::WebProcess::initializeConnection):
* WebProcess/WebProcess.h:

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

4 years agoSimple line layout: RunResolver::Iterator class cleanup.
zalan@apple.com [Mon, 6 Apr 2015 20:39:11 +0000 (20:39 +0000)]
Simple line layout: RunResolver::Iterator class cleanup.
https://bugs.webkit.org/show_bug.cgi?id=143445

Reviewed by Antti Koivisto.

1. SimpleLineLayout::Run is an intermediate structure and should not be publicly accessible through RunResolver::Iterator.
RunResolver::Run is the class to use to access run properties.
2. Also move advance()/advanceLine() to private. Callers should use LineResolver to advance on lines.

No change in functionality.

* rendering/SimpleLineLayoutResolver.h:

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

4 years agohttps://trac.webkit.org/changeset/182338 introduced a build failure that I
bdakin@apple.com [Mon, 6 Apr 2015 20:26:36 +0000 (20:26 +0000)]
https://trac.webkit.org/changeset/182338 introduced a build failure that I
attempted to fix with https://trac.webkit.org/changeset/182341 , but that disabled
the feature accidentally.  This should do the right thing.

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

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

4 years agoWebKit1.SetAndUpdateCacheModelPreferencesChangeMix fails on some machines
ap@apple.com [Mon, 6 Apr 2015 19:58:05 +0000 (19:58 +0000)]
WebKit1.SetAndUpdateCacheModelPreferencesChangeMix fails on some machines
https://bugs.webkit.org/show_bug.cgi?id=143450

Reviewed by Anders Carlsson.

* TestWebKitAPI/Tests/mac/SetAndUpdateCacheModel.mm: (TestWebKitAPI::TEST):
Make sure that the view is actually closed, regardless of anything else that happens beneath.
Also, removed unnecessary get() calls.

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

4 years ago[ES6] DFG and FTL should be aware of that StringConstructor behavior for symbols...
utatane.tea@gmail.com [Mon, 6 Apr 2015 19:07:12 +0000 (19:07 +0000)]
[ES6] DFG and FTL should be aware of that StringConstructor behavior for symbols becomes different from ToString
https://bugs.webkit.org/show_bug.cgi?id=143424

Reviewed by Geoffrey Garen.

In ES6, StringConstructor behavior becomes different from ToString abstract operations in the spec. (and JSValue::toString).

ToString(symbol) throws a type error.
However, String(symbol) produces SymbolDescriptiveString(symbol).

So, in DFG and FTL phase, they should not inline StringConstructor to ToString.

Now, in the template literals patch, ToString DFG operation is planned to be used.
And current ToString behavior is aligned to the spec (and JSValue::toString) and it's better.
So intead of changing ToString behavior, this patch adds CallStringConstructor operation into DFG and FTL.
In CallStringConstructor, all behavior in DFG analysis is the same.
Only the difference from ToString is, when calling DFG operation functions, it calls
operationCallStringConstructorOnCell and operationCallStringConstructor instead of
operationToStringOnCell and operationToString.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGBackwardsPropagationPhase.cpp:
(JSC::DFG::BackwardsPropagationPhase::propagate):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleConstantInternalFunction):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
(JSC::DFG::FixupPhase::fixupToStringOrCallStringConstructor):
(JSC::DFG::FixupPhase::attemptToMakeFastStringAdd):
(JSC::DFG::FixupPhase::fixupToString): Deleted.
* dfg/DFGNodeType.h:
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::propagate):
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileToStringOrCallStringConstructorOnCell):
(JSC::DFG::SpeculativeJIT::compileToStringOnCell): Deleted.
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGStructureRegistrationPhase.cpp:
(JSC::DFG::StructureRegistrationPhase::run):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::compileNode):
(JSC::FTL::LowerDFGToLLVM::compileToStringOrCallStringConstructor):
(JSC::FTL::LowerDFGToLLVM::compileToString): Deleted.
* runtime/StringConstructor.cpp:
(JSC::stringConstructor):
(JSC::callStringConstructor):
* runtime/StringConstructor.h:
* tests/stress/symbol-and-string-constructor.js: Added.
(performString):

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

4 years agoUnreviewed, rolling out r182296.
commit-queue@webkit.org [Mon, 6 Apr 2015 18:37:15 +0000 (18:37 +0000)]
Unreviewed, rolling out r182296.
https://bugs.webkit.org/show_bug.cgi?id=143448

This will disturb network cache efficacy logging, we should
reland this later. (Requested by cdumez__ on #webkit).

Reverted changeset:

"[WK2][NetworkCache] Drop HTTP method from NetworkCache::Key"
https://bugs.webkit.org/show_bug.cgi?id=143348
http://trac.webkit.org/changeset/182296

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

4 years agoUse a RenderObject bit for isRenderFlowThread()
simon.fraser@apple.com [Mon, 6 Apr 2015 17:00:54 +0000 (17:00 +0000)]
Use a RenderObject bit for isRenderFlowThread()
https://bugs.webkit.org/show_bug.cgi?id=143439

Reviewed by Darin Adler.

Turning isRenderFlowThread() into a bit in rare data rather than a virtual function reduces
the time under RenderLayer::scrollTo() on a large overflow:scroll table from 56% to 44%.

* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::RenderFlowThread):
* rendering/RenderFlowThread.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::setIsRenderFlowThread):
* rendering/RenderObject.h:
(WebCore::RenderObject::isDragging):
(WebCore::RenderObject::hasReflection):
(WebCore::RenderObject::isRenderFlowThread):
(WebCore::RenderObject::RenderObjectRareData::RenderObjectRareData):

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

4 years agoReduce the dependency on Flash in regression tests
ap@apple.com [Mon, 6 Apr 2015 16:28:52 +0000 (16:28 +0000)]
Reduce the dependency on Flash in regression tests
https://bugs.webkit.org/show_bug.cgi?id=143391

Reviewed by Anders Carlsson.

Tools:

* WebKitTestRunner/TestController.cpp: (WTR::TestController::decidePolicyForPluginLoad):
Only allow QuickTime and the test plug-in.

LayoutTests:

* accessibility/inline-block-assertion.html:
* accessibility/plugin.html:
* compositing/geometry/empty-embed-rects.html:
* fast/history/resources/subframe-with-plugin.html:
* fast/images/embed-does-not-propagate-dimensions-to-object-ancestor.html:
* fast/loader/loadInProgress.html:
* fast/replaced/border-radius-clip.html:
* fast/replaced/embed-display-none.html:
* plugins/crash-restoring-plugin-page-from-page-cache.html:
* plugins/object-embed-plugin-scripting.html:
* plugins/resources/plugin-frame.html:
Use TestNetscapePlugin, as the tests don't appear to have any real need for Flash.

* plugins/iframe-shims.html: Removed. This was a test for a chromium only feature
that never existed in WebKit.

* platform/mac/TestExpectations:
* platform/wincairo/TestExpectations:
Removed the deleted plugins/iframe-shims.html.

* platform/mac-wk2/TestExpectations: Skip snapshotting tests that use Flash,
because they make WebKitTestRunner crash now. Marked all other snapshotting tests
as Pass/Failure, because they don't really make any sense, and are only useful for
finsing crashes.

* platform/wk2/TestExpectations: Skipped a few remaining tests that use Flash.
These tests still run (and pass) under WebKit1, regardless of whether Flash is
installed, so they don't seem like very accurate tests.

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

4 years ago[Win] Unreviewed test update after r182369.
bfulgham@apple.com [Mon, 6 Apr 2015 15:49:52 +0000 (15:49 +0000)]
[Win] Unreviewed test update after r182369.

New test does not pass on Windows.

* platform/win/TestExpectations: Skip.

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

4 years ago[Win] [SVG -> OTF Converter] Support the SVG -> OTF Font Converter
mmaxfield@apple.com [Mon, 6 Apr 2015 15:30:49 +0000 (15:30 +0000)]
[Win] [SVG -> OTF Converter] Support the SVG -> OTF Font Converter
https://bugs.webkit.org/show_bug.cgi?id=143402

Patch by Myles C. Maxfield <mmaxfield@apple.com> on 2015-04-06
Reviewed by Darin Adler.

Source/WebCore:

There are a few pieces to the converter that Windows requires that we haven't already
implemented:
1. Checksums were being calculated with the wrong endianness
2. Windows requires a format 4 'cmap' subtable in addition to the format 12 one we already
were using
3. Windows requires a reference to a Private DICT inside the CFF table, even if the DICT
is of 0 length.

Covered by all our existing SVG font tests.

* svg/SVGFontFaceElement.h: Add capHeight accessor.
* svg/SVGFontFaceElement.cpp:
(WebCore::SVGFontFaceElement::capHeight): Ditto.
* svg/SVGToOTFConversion.cpp: Update the conversion process according to the above
requirements.
(WebCore::SVGToOTFFontConverter::appendFormat12CMAPTable):
(WebCore::SVGToOTFFontConverter::appendFormat4CMAPTable):
(WebCore::SVGToOTFFontConverter::appendCMAPTable): Use helpers.
(WebCore::SVGToOTFFontConverter::appendHHEATable): Use member variables.
(WebCore::SVGToOTFFontConverter::appendOS2Table): Update to version 2.
(WebCore::SVGToOTFFontConverter::appendCFFTable): Create a reference to a
zero-sized Private DICT
(WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter): Populate member
variables.
(WebCore::SVGToOTFFontConverter::calculateChecksum): Flip endianness

WebKitLibraries:

* win/tools/vsprops/FeatureDefines.props: Enable the define.

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

4 years agoReturn Optional<uint32_t> from PropertyName::asIndex
utatane.tea@gmail.com [Mon, 6 Apr 2015 12:40:33 +0000 (12:40 +0000)]
Return Optional<uint32_t> from PropertyName::asIndex
https://bugs.webkit.org/show_bug.cgi?id=143422

Reviewed by Darin Adler.

Source/JavaScriptCore:

PropertyName::asIndex returns uint32_t and use UINT_MAX as NotAnIndex.
But it's not obvious to callers.

This patch changes
1. PropertyName::asIndex() to return Optional<uint32_t> and
2. function name `asIndex()` to `parseIndex()`.
It forces callers to check the value is index or not explicitly.

* bytecode/GetByIdStatus.cpp:
(JSC::GetByIdStatus::computeFor):
* bytecode/PutByIdStatus.cpp:
(JSC::PutByIdStatus::computeFor):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitDirectPutById):
* jit/Repatch.cpp:
(JSC::emitPutTransitionStubAndGetOldStructure):
* jsc.cpp:
* runtime/ArrayPrototype.cpp:
(JSC::arrayProtoFuncSort):
* runtime/GenericArgumentsInlines.h:
(JSC::GenericArguments<Type>::getOwnPropertySlot):
(JSC::GenericArguments<Type>::put):
(JSC::GenericArguments<Type>::deleteProperty):
(JSC::GenericArguments<Type>::defineOwnProperty):
* runtime/Identifier.h:
(JSC::parseIndex):
(JSC::Identifier::isSymbol):
* runtime/JSArray.cpp:
(JSC::JSArray::defineOwnProperty):
* runtime/JSCJSValue.cpp:
(JSC::JSValue::putToPrimitive):
* runtime/JSGenericTypedArrayViewInlines.h:
(JSC::JSGenericTypedArrayView<Adaptor>::getOwnPropertySlot):
(JSC::JSGenericTypedArrayView<Adaptor>::put):
(JSC::JSGenericTypedArrayView<Adaptor>::defineOwnProperty):
(JSC::JSGenericTypedArrayView<Adaptor>::deleteProperty):
* runtime/JSObject.cpp:
(JSC::JSObject::put):
(JSC::JSObject::putDirectAccessor):
(JSC::JSObject::putDirectCustomAccessor):
(JSC::JSObject::deleteProperty):
(JSC::JSObject::putDirectMayBeIndex):
(JSC::JSObject::defineOwnProperty):
* runtime/JSObject.h:
(JSC::JSObject::getOwnPropertySlot):
(JSC::JSObject::getPropertySlot):
(JSC::JSObject::putDirectInternal):
* runtime/JSString.cpp:
(JSC::JSString::getStringPropertyDescriptor):
* runtime/JSString.h:
(JSC::JSString::getStringPropertySlot):
* runtime/LiteralParser.cpp:
(JSC::LiteralParser<CharType>::parse):
* runtime/PropertyName.h:
(JSC::parseIndex):
(JSC::toUInt32FromCharacters): Deleted.
(JSC::toUInt32FromStringImpl): Deleted.
(JSC::PropertyName::asIndex): Deleted.
* runtime/PropertyNameArray.cpp:
(JSC::PropertyNameArray::add):
* runtime/StringObject.cpp:
(JSC::StringObject::deleteProperty):
* runtime/Structure.cpp:
(JSC::Structure::prototypeChainMayInterceptStoreTo):

Source/WebCore:

* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::getOwnPropertySlot):
(WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
* bindings/js/JSHTMLAllCollectionCustom.cpp:
(WebCore::callHTMLAllCollection):
(WebCore::JSHTMLAllCollection::item):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateGetOwnPropertySlotBody):
(GenerateImplementation):
* bindings/scripts/test/JS/JSFloat64Array.cpp:
(WebCore::JSFloat64Array::getOwnPropertySlot):
(WebCore::JSFloat64Array::getOwnPropertyDescriptor):
(WebCore::JSFloat64Array::put):
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
(WebCore::JSTestEventTarget::getOwnPropertySlot):
* bridge/runtime_array.cpp:
(JSC::RuntimeArray::getOwnPropertySlot):
(JSC::RuntimeArray::put):

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

4 years ago[WK2] API::Array::copy() should move the resulting Vector<> of copies into the Array...
zandobersek@gmail.com [Mon, 6 Apr 2015 09:55:07 +0000 (09:55 +0000)]
[WK2] API::Array::copy() should move the resulting Vector<> of copies into the Array::create() call
https://bugs.webkit.org/show_bug.cgi?id=143413

Reviewed by Darin Adler.

Move the Vector<> object containing the copied elements into the Array::create()
call, avoiding copying all the elements again.

While here, change the Vector<> parameters for Array::create() and the Array
constructor to rvalue references. This will ensure that the passed-in object
is moved into the Array::create() call if possible, or explicitly copied
otherwise. The constructor is moved into the header for inlining opportunities
and the unnecessary parameter in the create(Vector<>&&) method declaration
removed.

* Shared/API/APIArray.cpp:
(API::Array::create):
(API::Array::copy):
(API::Array::Array): Deleted.
* Shared/API/APIArray.h:

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

4 years agoW3C test importer should generate the modules installed dynamically to run wpt tests
youenn.fablet@crf.canon.fr [Mon, 6 Apr 2015 09:06:03 +0000 (09:06 +0000)]
W3C test importer should generate the modules installed dynamically to run wpt tests
https://bugs.webkit.org/show_bug.cgi?id=142738

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Renamed WPTModules to web-platform-test-modules.json
Updated TestRepositories to ask the importer to generate web-platform-test-modules.json at import time.

* resources/TestRepositories:
* resources/WPTModules: Removed.
* resources/web-platform-tests-modules.json: Added.

Tools:

The test importer can now generate the submodules description file based on information extracted from the corresponding git repository.
The implementation is done within TestDownloader and it is activated for the WPT repository.
LayoutTests/imported/w3c/resources/WPTModules is renamed as LayoutTests/imported/w3c/resources/web-platform-tests-modules.json for that reason.

* Scripts/webkitpy/layout_tests/servers/web_platform_test_server.py:
(WebPlatformTestServer._install_modules): Updated to cope with path as array.
* Scripts/webkitpy/w3c/test_downloader.py:
(TestDownloader._git_submodules_status): Added so that it can be overriden for unit tests.
(TestDownloader):
(TestDownloader._git_submodules_description): Computes submodule description.
(TestDownloader.generate_git_submodules_description): Write submodule description in a file.
* Scripts/webkitpy/w3c/test_importer.py:
(TestImporter.do_import): Added the possibility to post process the tests.
(TestImporter):
(TestImporter.generate_git_submodules_description_for_all_repositories): Enable generating module description file.
(TestImporter.should_convert_test_harness_links): Updated according new options format.
* Scripts/webkitpy/w3c/test_importer_unittest.py:
(TestImporterTest.import_downloaded_tests): Making use of TestDownloaderMock.
(TestImporterTest.import_downloaded_tests.TestDownloaderMock): Added to override submodule status gathering.
(TestImporterTest.import_downloaded_tests.TestDownloaderMock.__init__):
(TestImporterTest.import_downloaded_tests.TestDownloaderMock._git_submodules_status):
(TestImporterTest.test_submodules_generation): Added to check that modules description files works.

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

4 years agoFileList constructor should move the passed-in Vector<> rvalue reference into the...
zandobersek@gmail.com [Mon, 6 Apr 2015 07:22:35 +0000 (07:22 +0000)]
FileList constructor should move the passed-in Vector<> rvalue reference into the member variable
https://bugs.webkit.org/show_bug.cgi?id=143412

Reviewed by Darin Adler.

* fileapi/FileList.h:
(WebCore::FileList::FileList): An explicit move of the passed-in rvalue
reference into the member variable is required, otherwise a copy is
performed since an rvalue reference is just an lvalue.

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

4 years agoSource/WebCore:
zandobersek@gmail.com [Mon, 6 Apr 2015 07:21:21 +0000 (07:21 +0000)]
Source/WebCore:
UserScript, UserStyleSheet constructors should take in Vector<String> rvalue references
https://bugs.webkit.org/show_bug.cgi?id=143411

Reviewed by Darin Adler.

Have the UserScript and UserStyleSheet constructors take in Vector<String>
rvalue references for the whitelist and blacklist parameters. Both classes
store these Vector<String> objects, so the referenced objects can simply be
moved into the member variable.

Because the constructor is now demanding an rvalue, it's up to the caller
to move in the desired object if possible, or create an explicit copy
otherwise.

* page/UserScript.h:
(WebCore::UserScript::UserScript):
* page/UserStyleSheet.h:
(WebCore::UserStyleSheet::UserStyleSheet):

Source/WebKit2:
UserScript, UserStyleSheet constructors should take in Vector<String> rvalues
https://bugs.webkit.org/show_bug.cgi?id=143411

Reviewed by Darin Adler.

Move the whitelist and blacklist Vector<String> objects into the
UserScript and UserStyleSheet constructors in ArgumentCoder<T>::decode
functions.

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<UserStyleSheet>::decode):
(IPC::ArgumentCoder<UserScript>::decode):

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

4 years ago[Content Filtering] Only pass http(s) requests to -[NEFilterSource willSendRequest...
aestes@apple.com [Mon, 6 Apr 2015 05:24:21 +0000 (05:24 +0000)]
[Content Filtering] Only pass http(s) requests to -[NEFilterSource willSendRequest:...]
https://bugs.webkit.org/show_bug.cgi?id=143437

Reviewed by Dan Bernstein.

No new tests. We can't test NEFilterSource directly.

* platform/cocoa/NetworkExtensionContentFilter.mm:
(WebCore::NetworkExtensionContentFilter::willSendRequest): Immediately allow requests with url schemes other than http and https.

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

4 years ago[Content Filtering] Add some additional unblock tests
aestes@apple.com [Mon, 6 Apr 2015 04:48:33 +0000 (04:48 +0000)]
[Content Filtering] Add some additional unblock tests
https://bugs.webkit.org/show_bug.cgi?id=143435

Reviewed by Dan Bernstein.

* contentfiltering/block-after-add-data-then-allow-unblock-expected.html: Copied from LayoutTests/contentfiltering/block-after-unblock-request-expected.html.
* contentfiltering/block-after-add-data-then-allow-unblock.html: Added.
* contentfiltering/block-after-add-data-then-deny-unblock-expected.html: Renamed from LayoutTests/contentfiltering/allow-after-unblock-request-expected.html.
* contentfiltering/block-after-add-data-then-deny-unblock.html: Added.
* contentfiltering/block-after-finished-adding-data-then-allow-unblock-expected.html: Copied from LayoutTests/contentfiltering/block-after-unblock-request-expected.html.
* contentfiltering/block-after-finished-adding-data-then-allow-unblock.html: Renamed from LayoutTests/contentfiltering/allow-after-unblock-request.html.
* contentfiltering/block-after-finished-adding-data-then-deny-unblock-expected.html: Copied from LayoutTests/contentfiltering/block-after-unblock-request-expected.html.
* contentfiltering/block-after-finished-adding-data-then-deny-unblock.html: Renamed from LayoutTests/contentfiltering/block-after-unblock-request.html.
* contentfiltering/block-after-response-then-allow-unblock-expected.html: Copied from LayoutTests/contentfiltering/block-after-unblock-request-expected.html.
* contentfiltering/block-after-response-then-allow-unblock.html: Added.
* contentfiltering/block-after-response-then-deny-unblock-expected.html: Copied from LayoutTests/contentfiltering/block-after-unblock-request-expected.html.
* contentfiltering/block-after-response-then-deny-unblock.html: Added.
* contentfiltering/block-after-will-send-request-then-allow-unblock-expected.html: Copied from LayoutTests/contentfiltering/block-after-unblock-request-expected.html.
* contentfiltering/block-after-will-send-request-then-allow-unblock.html: Added.
* contentfiltering/block-after-will-send-request-then-deny-unblock-expected.html: Renamed from LayoutTests/contentfiltering/block-after-unblock-request-expected.html.
* contentfiltering/block-after-will-send-request-then-deny-unblock.html: Added.

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

4 years agoWeb Inspector: Add String/Array "includes" parameter display string
commit-queue@webkit.org [Mon, 6 Apr 2015 04:01:43 +0000 (04:01 +0000)]
Web Inspector: Add String/Array "includes" parameter display string
https://bugs.webkit.org/show_bug.cgi?id=143434

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

* UserInterface/Models/NativeFunctionParameters.js:

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

4 years agoFrameView code uses page() without null checking
darin@apple.com [Mon, 6 Apr 2015 03:29:06 +0000 (03:29 +0000)]
FrameView code uses page() without null checking
https://bugs.webkit.org/show_bug.cgi?id=143425
rdar://problem/18920601

Reviewed by Anders Carlsson.

While we don't have tests that cover this, we are seeing crashes coming in
that indicate the shouldEnableSpeculativeTilingDuringLoading function is
being called when the page is null. This patch adds null checks to all the
places in FrameView that use page() without doing null checking.

* page/FrameView.cpp:
(WebCore::FrameView::layout): If page is null, don't try to do the
auto-sizing logic that involves the textAutosizingWidth value from the page.
(WebCore::FrameView::setFixedVisibleContentRect): Get settings from the
frame rather than the page to avoid possible null-dereference.
(WebCore::FrameView::scrollPositionChanged): Check the page for null when
getting the event throttling delay.
(WebCore::FrameView::updateLayerFlushThrottling): Check the page for null,
and return early if it is null.
(WebCore::shouldEnableSpeculativeTilingDuringLoading): Check the page for
null, and return false if it is null.
(WebCore::FrameView::performPostLayoutTasks): Guard the code that calls
didLayout on the page client by a check if the page is null.
(WebCore::FrameView::pagination): Don't call Page::pagination on a null
page here.
(WebCore::FrameView::visibleContentScaleFactor): Use a scale factor of 1
if the page is null.
(WebCore::FrameView::setVisibleScrollerThumbRect): Don't call through to
the page client if the page is null.
(WebCore::FrameView::scrollbarStyleChanged): Ditto.
(WebCore::FrameView::setScrollPinningBehavior): Check the page for null
before asking it for the scrolling coordinator.

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

4 years agoFree up some bits in RenderObject by moving rarely used bits into a side table
simon.fraser@apple.com [Mon, 6 Apr 2015 02:59:57 +0000 (02:59 +0000)]
Free up some bits in RenderObject by moving rarely used bits into a side table
https://bugs.webkit.org/show_bug.cgi?id=143432

Reviewed by Darin Adler.

Add a side table (global hash) on RenderObject to store data that is rarely
used. Move the "isDragging" and "hasReflection" bits there. Re-use one of
those bits for "hasRareData", and leave the other unused (I have plans for it).

* rendering/RenderBlock.cpp:
(WebCore::getBlockRareData): Renamed for consistency.
(WebCore::ensureBlockRareData): Renamed to avoid conflict with RenderObject::ensureRareData().
(WebCore::RenderBlock::cachedFlowThreadContainingBlock):
(WebCore::RenderBlock::cachedFlowThreadContainingBlockNeedsUpdate):
(WebCore::RenderBlock::setCachedFlowThreadContainingBlockNeedsUpdate):
(WebCore::RenderBlock::updateCachedFlowThreadContainingBlock):
(WebCore::RenderBlock::locateFlowThreadContainingBlock):
(WebCore::RenderBlock::paginationStrut):
(WebCore::RenderBlock::pageLogicalOffset):
(WebCore::RenderBlock::setPaginationStrut):
(WebCore::RenderBlock::setPageLogicalOffset):
(WebCore::getRareData): Deleted.
(WebCore::ensureRareData): Deleted.
* rendering/RenderObject.cpp:
(WebCore::RenderObject::~RenderObject): Assert that rare data hasn't been resurrected
since willBeDestroyed().
(WebCore::RenderObject::willBeDestroyed): Clear the rare data.
(WebCore::RenderObject::setIsDragging): If setting, ensure that we have rare data and
set the bit. Otherwise, only clear the bit of we have rare data.
(WebCore::RenderObject::setHasReflection): Ditto.
(WebCore::RenderObject::rareDataMap):
(WebCore::RenderObject::rareData):
(WebCore::RenderObject::ensureRareData):
(WebCore::RenderObject::clearRareData):
* rendering/RenderObject.h:
(WebCore::RenderObject::isDragging): Fast-fail on the hasRareData() bit, then do the
slower lookup in rare data.
(WebCore::RenderObject::hasReflection): Ditto.
(WebCore::RenderObject::setEverHadLayout): Moved up to group with other bit setters.
(WebCore::RenderObject::hasRareData):
(WebCore::RenderObject::setHasRareData):
(WebCore::RenderObject::RenderObjectBitfields::RenderObjectBitfields):
(WebCore::RenderObject::RenderObjectRareData::RenderObjectRareData):
(WebCore::RenderObject::setHasReflection): Deleted. Out of line now.
(WebCore::RenderObject::setIsDragging): Deleted. Ditto.

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

4 years agoWeb Inspector: Regression: Map instances don't expand
commit-queue@webkit.org [Mon, 6 Apr 2015 01:56:28 +0000 (01:56 +0000)]
Web Inspector: Regression: Map instances don't expand
https://bugs.webkit.org/show_bug.cgi?id=143428

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-04-05
Reviewed by Brian Burg.

Fix uses of "this" in super() calls. Also fix a style name
that no longer exists and was intended to be inlined.

* UserInterface/Views/IndexedDatabaseObjectStoreTreeElement.js:
(WebInspector.IndexedDatabaseObjectStoreTreeElement):
* UserInterface/Views/IndexedDatabaseTreeElement.js:
(WebInspector.IndexedDatabaseTreeElement):
* UserInterface/Views/ObjectTreeMapEntryTreeElement.js:
(WebInspector.ObjectTreeMapEntryTreeElement):

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

4 years agoREGRESSION (r181778): Crash after scrolling Google search result page
darin@apple.com [Mon, 6 Apr 2015 01:43:32 +0000 (01:43 +0000)]
REGRESSION (r181778): Crash after scrolling Google search result page
https://bugs.webkit.org/show_bug.cgi?id=143431

Reviewed by Simon Fraser.

I can't reproduce this crash, nor was I able to make a regression test,
but the crash data makes it clear this is a null dereference.

* page/animation/AnimationController.cpp:
(WebCore::AnimationControllerPrivate::scrollWasUpdated): Check the result
of Frame::view for null. We know this is only called when there is a
valid FrameView, but it can be called after Frame::m_view is already null.

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

4 years agoURI encoding/escaping should use efficient string building instead of calling snprintf().
akling@apple.com [Mon, 6 Apr 2015 01:32:12 +0000 (01:32 +0000)]
URI encoding/escaping should use efficient string building instead of calling snprintf().
<https://webkit.org/b/143426>

Reviewed by Gavin Barraclough.

I saw 0.5% of main thread time in snprintf() on <http://polymerlabs.github.io/benchmarks/>
which seemed pretty silly. This change gets that down to nothing in favor of using our
existing JSStringBuilder and HexNumber.h facilities.

These APIs are well-exercised by our existing test suite.

* runtime/JSGlobalObjectFunctions.cpp:
(JSC::encode):
(JSC::globalFuncEscape):

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