[CSS Grid Layout] Guard RenderObject::isRenderGrid() method
https://bugs.webkit.org/show_bug.cgi?id=132380

Reviewed by Benjamin Poulain.

Guard RenderObject::isRenderGrid() method under ENABLE_CSS_GRID_LAYOUT compilation flag.

* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeLogicalWidthInRegion):
* rendering/RenderObject.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169195 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Grid Layout] Split the grid-item-margin-auto-columns-rows.html test.
https://bugs.webkit.org/show_bug.cgi?id=131064

Patch by Javier Fernandez <jfernandez@igalia.com> on 2014-05-22
Reviewed by Benjamin Poulain.

Splitting the "grid-item-margin-auto-columns-rows" into different writing-modes
related tests, so besides increasing clarity, it makes it fit in the 800x600 viewport.

* fast/css-grid-layout/grid-item-margin-auto-columns-rows-expected.html: Removed.
* fast/css-grid-layout/grid-item-margin-auto-columns-rows.html: Removed.
* fast/css-grid-layout/grid-item-margin-auto-columns-rows-horizontal-ltr-expected.html: Added.
* fast/css-grid-layout/grid-item-margin-auto-columns-rows-horizontal-ltr.html: Added.
* fast/css-grid-layout/grid-item-margin-auto-columns-rows-horizontal-rtl-expected.html: Added.
* fast/css-grid-layout/grid-item-margin-auto-columns-rows-horizontal-rtl.html: Added.
* fast/css-grid-layout/grid-item-margin-auto-columns-rows-vertical-ltr-expected.html: Added.
* fast/css-grid-layout/grid-item-margin-auto-columns-rows-vertical-ltr.html: Added.
* fast/css-grid-layout/grid-item-margin-auto-columns-rows-vertical-rtl-expected.html: Added.
* fast/css-grid-layout/grid-item-margin-auto-columns-rows-vertical-rtl.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169197 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Text markers don't paint on simple lines
https://bugs.webkit.org/show_bug.cgi?id=133177

Reviewed by Anders Carlsson.

Source/WebCore: 
        
Marker painting code does not yet support simple lines.

Tests: fast/text/mark-matches-rendering-simple-lines.html
       fast/text/mark-matches-rendering.html

* dom/DocumentMarkerController.cpp:
(WebCore::DocumentMarkerController::addMarker):
        
    Force text blocks with markers to use line boxes.

* testing/Internals.cpp:
(WebCore::Internals::setMarkedTextMatchesAreHighlighted):
        
    Expose this so we can make reftests for marker rendering.

* testing/Internals.h:
* testing/Internals.idl:

LayoutTests: 

* fast/text/mark-matches-rendering-expected.html: Added.
* fast/text/mark-matches-rendering-simple-lines-expected.html: Added.
* fast/text/mark-matches-rendering-simple-lines.html: Added.
* fast/text/mark-matches-rendering.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169199 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Video is resumed with old playback rate.
https://bugs.webkit.org/show_bug.cgi?id=132905

Patch by Piotr Grad <p.grad@samsung.com> on 2014-05-22
Reviewed by Philippe Normand.

Source/WebCore:
Setting '0' playback rate is causing pipeline to pause.
GStreamer player impl. exposed this information to upper layers but it should not.
Solution is to hidden such situation behind m_playbackRatePause flag.

Test: media/video-paused-0-rate.html

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
(WebCore::MediaPlayerPrivateGStreamer::play):
(WebCore::MediaPlayerPrivateGStreamer::pause):
(WebCore::MediaPlayerPrivateGStreamer::doSeek):
(WebCore::MediaPlayerPrivateGStreamer::updatePlaybackRate):
(WebCore::MediaPlayerPrivateGStreamer::paused):
(WebCore::MediaPlayerPrivateGStreamer::setRate):
(WebCore::MediaPlayerPrivateGStreamer::updateStates):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:

LayoutTests:
* media/video-paused-0-rate-expected.txt: Added.
* media/video-paused-0-rate.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169200 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed EFL gardening

Add test expectations for failing tests.

* platform/efl-wk2/TestExpectations:
* platform/efl/editing/apply-style-iframe-crash-expected.txt: Added after r168641.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169202 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r163712): [GTK] Misspelling and grammar underline marks are no longer drawn
https://bugs.webkit.org/show_bug.cgi?id=133047

Reviewed by Darin Adler.

Change two conditions changed by mistake in r163712.

* editing/TextCheckingHelper.cpp:
(WebCore::findMisspellings): Enter the loop also when wordStart is 0.
(WebCore::TextCheckingHelper::findFirstMisspelling): Skip the work
when the text is a single character. Also reworked it to use a for
loop to improve the readability.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169203 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION (WebKit2): Keyboard should have Search button in duckduckgo.com.
https://bugs.webkit.org/show_bug.cgi?id=133183
<rdar://problem/17004207>

Reviewed by Geoff Garen.


Source/WebCore: 
Adding new export.

* WebCore.exp.in:

Source/WebKit2: 
The keyboard type should be search if the input type is search
or if it is text and it is inside a form with an action and either
name, id or title contain the word search. This matches the
heuristics we have in WK1 for iOS.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getAssistedNodeInformation):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169207 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS][WK2] Application cache is broken
https://bugs.webkit.org/show_bug.cgi?id=133172
<rdar://problem/16994593>

Reviewed by Andy Estes.

* UIProcess/mac/WebContextMac.mm:
(WebKit::WebContext::platformDefaultApplicationCacheDirectory): Use a proper
path for application cache database (same as WebKit1).


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169208 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[MSE] Stored samples are not freed when SourceBuffer is removed from MediaSource
https://bugs.webkit.org/show_bug.cgi?id=133174

Reviewed by Eric Carlson.

Clear out stored MediaSamples from SourceBuffer's TrackBuffer storage when
aborting loading. Also, report the memory cost of those samples, so that the
SourceBuffer will be GCd more readily.

Add a mechanism for reporting the size of a MediaSample:
* Modules/mediasource/SourceBuffer.h:
* platform/MediaSample.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
* platform/mock/mediasource/MockSourceBufferPrivate.cpp:

Track the memory usage of a SampleMap when adding and removing samples, as well
as allowing the SampleMap to be cleared wholesale:
* Modules/mediasource/SampleMap.cpp:
(WebCore::SampleMap::clear): Release all stored MediaSamples.
(WebCore::SampleMap::addSample): Update m_totalSize.
(WebCore::SampleMap::removeSample): Ditto.
* Modules/mediasource/SampleMap.h:
(WebCore::SampleMap::SampleMap): Initialize m_totalSize.
(WebCore::SampleMap::sizeInBytes): Simple accessor.

Clear the stored samples when loading is aborted, and report the extra memory
cost
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::SourceBuffer): Initialize m_reportedExtraMemoryCost.
(WebCore::SourceBuffer::removedFromMediaSource): Clear all stored samples.
(WebCore::SourceBuffer::sourceBufferPrivateAppendComplete): Call reportExtraMemoryCost().
(WebCore::SourceBuffer::reportExtraMemoryCost): Inform the vm of the new
    extra memory cost incurred by the object.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169209 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS] Add CFBundleAllowMixedLocalizations to WebContentService
https://bugs.webkit.org/show_bug.cgi?id=133187
<rdar://problem/16561084>

Reviewed by Tim Horton.

* WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-iOS.plist:
We already had it in WebContentService.Development, just not here.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169214 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add option to run-jsc-stress-tests to use installed jsc
https://bugs.webkit.org/show_bug.cgi?id=133102

Reviewed by Geoffrey Garen.

Added --no-copy option to not copy a JavaScriptCore framework, but use the one
provied with the --jsc option.

* Scripts/run-jsc-stress-tests:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169217 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r154797): Debugger crashes when stepping over an uncaught exception.
<https://webkit.org/b/133182>

Reviewed by Oliver Hunt.


Source/JavaScriptCore: 
Before r154797, we used to clear the VM exception before calling into the
debugger.  After r154797, we don't.  This patch will restore this clearing
of the exception before calling into the debugger.

Also added assertions after returning from calls into the debugger to
ensure that the debugger did not introduce any exceptions.

* interpreter/Interpreter.cpp:
(JSC::unwindCallFrame):
(JSC::Interpreter::unwind):
(JSC::Interpreter::debug):
- Fixed the assertion here.  Interpreter::debug() should never be called
  with a pending exception.  Debugger callbacks for exceptions should be
  handled by Interpreter::unwind() and Interpreter::unwindCallFrame().

LayoutTests: 
* inspector-protocol/debugger/regress-133182-expected.txt: Added.
* inspector-protocol/debugger/regress-133182.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169221 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS] Enable -apple-system- styled elements to respond to system font size changes.
https://bugs.webkit.org/show_bug.cgi?id=133186
<rdar://problem/16583782>

Reviewed by Enrica Casucci.

Source/WebCore:
* WebCore.exp.in:
* WebCore.xcodeproj/project.pbxproj:
* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
(WebCore::_contentSizeCategory):
(WebCore::RenderThemeIOS::contentSizeCategory):
(WebCore::RenderThemeIOS::setContentSizeCategory):

Source/WebKit2:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView initWithFrame:configuration:]):
(-[WKWebView _contentSizeCategoryDidChange:]):
(-[WKWebView _contentSizeCategory]):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::contentSizeCategoryDidChange):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::contentSizeCategoryDidChange):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169223 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION (r155977): Very stuttery 3D css animation on jtechcommunications.com
https://bugs.webkit.org/show_bug.cgi?id=133179
<rdar://problem/16864666>

Reviewed by Dean Jackson.

Source/WebCore:

Revert code added in r155977 to try to pick a good contentsScale for layers
based on a root-relative transform. This resulted in pages with too much
backing store, and too many cases where layers repainted during animations,
causing stutter.

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::GraphicsLayerCA):
(WebCore::GraphicsLayerCA::flushCompositingState):
(WebCore::GraphicsLayerCA::recursiveCommitChanges):
(WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
(WebCore::GraphicsLayerCA::updateContentsOpaque):
(WebCore::GraphicsLayerCA::updateAnimations):
(WebCore::GraphicsLayerCA::appendToUncommittedAnimations):
(WebCore::GraphicsLayerCA::setTransformAnimationEndpoints):
(WebCore::GraphicsLayerCA::setTransformAnimationKeyframes):
(WebCore::GraphicsLayerCA::updateContentsScale):
(WebCore::clampedContentsScaleForScale): Deleted.
(WebCore::maxScaleFromTransform): Deleted.
(WebCore::GraphicsLayerCA::updateRootRelativeScale): Deleted.
(WebCore::GraphicsLayerCA::getTransformFromAnimationsWithMaxScaleImpact): Deleted.
* platform/graphics/ca/GraphicsLayerCA.h:

LayoutTests:

Rebaseline.

* compositing/contents-scale/animating-expected.txt:
* compositing/contents-scale/rounded-contents-scale-expected.txt:
* compositing/contents-scale/scaled-ancestor-expected.txt:
* compositing/contents-scale/simple-scale-expected.txt:
* compositing/contents-scale/z-translate-expected.txt:
* platform/mac/compositing/overflow/composited-scrolling-paint-phases-expected.txt:
* platform/mac/compositing/tiling/rotated-tiled-clamped-expected.txt:
* platform/mac/compositing/tiling/rotated-tiled-preserve3d-clamped-expected.txt:
* platform/mac/compositing/visible-rect/nested-transform-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169229 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix the  compositing/transitions/transform-on-large-layer.html test
https://bugs.webkit.org/show_bug.cgi?id=133195

Reviewed by Dean Jackson.

This test used window resize when it doesn't need to and was flakey.

* compositing/transitions/transform-on-large-layer.html:
* platform/efl/TestExpectations:
* platform/mac/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169232 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS] Send shareable resources to QuickLook if enabled
https://bugs.webkit.org/show_bug.cgi?id=133189
<rdar://problem/17003995>

Reviewed by Brady Eidson.

Like we do for didReceiveData(), we need to pass an incoming ShareableResource to QuickLook if a QuickLook
handle exists.

* Shared/ShareableResource.cpp:
(WebKit::ShareableResource::Handle::tryWrapInCFData): Return the shared resource in a CFDataRef.
(WebKit::ShareableResource::Handle::tryWrapInSharedBuffer): Implemented in terms of tryWrapInCFData().
* Shared/ShareableResource.h:
* WebProcess/Network/WebResourceLoader.cpp:
(WebKit::WebResourceLoader::didReceiveResource): If a QuickLook handle exists, send the shareable resource to
it via a CFDataRef.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169233 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Captions layout incorrectly in fullscreen.
https://bugs.webkit.org/show_bug.cgi?id=133175

Patch by Jeremy Jones <jeremyj@apple.com> on 2014-05-22
Reviewed by Eric Carlson.

When doing layout for fullscreen, geometry should be absolute so it is not influenced
by the rest of the page. This change adds style for CSSPropertyPosition, CSSPropertyLeft,
and CSSPropertyTop.

* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTextTrackContainerElement::updateDisplay):
Refactor style changes into updateStyleForTextTrackRepresentation().
(WebCore::MediaControlTextTrackContainerElement::updateTimerFired):
Refactor style changes into updateStyleForTextTrackRepresentation().
(WebCore::MediaControlTextTrackContainerElement::clearTextTrackRepresentation):
Refactor style changes into updateStyleForTextTrackRepresentation().
(WebCore::MediaControlTextTrackContainerElement::updateStyleForTextTrackRepresentation):
Consolidate style changes here. Include the two existing and three new style changes.
* html/shadow/MediaControlElements.h:
Declare updateStyleForTextTrackRepresentation().

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169234 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Don't scan for phone numbers in editable regions
<rdar://problem/16949846> and https://bugs.webkit.org/show_bug.cgi?id=133192

Reviewed by Enrica Casucci.

No new tests (Currently untested WK2-only feature)

* editing/Editor.cpp:
(WebCore::Editor::scanRangeForTelephoneNumbers): Skip the range if the Node is editable.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169235 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Hook up a setting for showing detailed logging during memory pressure relief.
<https://webkit.org/b/133194>

Source/WebCore:
Make the pressure relief logger opt-in. Also make it flush memory back to the
OS (for both malloc and FastMalloc) to get more accurate numbers at each step.

Reviewed by Gavin Barraclough.

* WebCore.exp.in:
* platform/MemoryPressureHandler.cpp:
* platform/MemoryPressureHandler.h:
(WebCore::MemoryPressureHandler::ReliefLogger::ReliefLogger):
(WebCore::MemoryPressureHandler::ReliefLogger::~ReliefLogger):
(WebCore::MemoryPressureHandler::ReliefLogger::setLoggingEnabled):
* platform/cocoa/MemoryPressureHandlerCocoa.mm:
(WebCore::MemoryPressureHandler::ReliefLogger::platformMemoryUsage):

Source/WebKit2:
Plumb through the same setting that we used for detailed logging in WK1.

Reviewed by Gavin Barraclough.

* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
(WebKit::WebProcessCreationParameters::encode):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* UIProcess/mac/WebContextMac.mm:
(WebKit::WebContext::platformInitializeWebProcess):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169236 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS WebKit2] Web process should try to shrink its memory footprint when going into background.
<https://webkit.org/b/133197>
<rdar://problem/17011561>

Source/WebCore:
Make releaseMemory() public so we can call it from the process-will-suspend callback.

Reviewed by Gavin Barraclough.

* WebCore.exp.in:
* platform/MemoryPressureHandler.h:

Source/WebKit2:
Try to free up as much memory as possible before going into background.

Reviewed by Gavin Barraclough.

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::processWillSuspend):

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