[CSS Grid Layout] Properly support for z-index on grid items
https://bugs.webkit.org/show_bug.cgi?id=103329

Reviewed by Benjamin Poulain.

From Blink r157620 by <jchaffraix@chromium.org> and r172402 by
<wangxianzhu@chromium.org>.

Source/WebCore:
The specification says that grid should match flexbox and force
grid items to be stacking context if z-index is set, regardless
of 'position'. After this change, this is what happens.

Previously z-index changes of static positioned objects were ignored.
However, z-index is applicable for some static positioned objects,
such as grid items. Ignoring them makes the object not to be properly
painted on z-index change.

As StyleResolver has ensured that z-index is non-auto only if
applicable, RenderStyle::changeRequiresLayerRepaint() should not check
again (with inconsistent conditions).

Tests: fast/css-grid-layout/grid-item-z-index-change-repaint.html
       fast/css-grid-layout/grid-item-z-index-stacking-context.html
       fast/css-grid-layout/grid-item-z-index-support.html

* css/StyleResolver.cpp:
(WebCore::isDisplayFlexibleOrGridBox): Add new method to check if parent
display is flexbox or grid.
(WebCore::StyleResolver::adjustRenderStyle): Use new method in z-index
condition.
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::changeRequiresLayerRepaint): Move z-index checks
out of non-static positioned objects if.

LayoutTests:
* css3/blending/repaint/blend-mode-turn-off-isolation-expected.txt: Test rebaseline.
* fast/css-grid-layout/grid-item-z-index-change-repaint-expected.html: Added.
* fast/css-grid-layout/grid-item-z-index-change-repaint.html: Added.
* fast/css-grid-layout/grid-item-z-index-stacking-context-expected.html: Added.
* fast/css-grid-layout/grid-item-z-index-stacking-context.html: Added.
* fast/css-grid-layout/grid-item-z-index-support-expected.txt: Added.
* fast/css-grid-layout/grid-item-z-index-support.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170474 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Add support for constants in GObject DOM bindings
https://bugs.webkit.org/show_bug.cgi?id=133983

Reviewed by Martin Robinson.

* bindings/gobject/webkitdom.symbols: Add stable constants.
* bindings/scripts/CodeGeneratorGObject.pm:
(GenerateHeader): Add constants to the header.
(Generate): Pass the interface object to GenerateHeader to get the constants
(IsInterfaceSymbol): Helper function that returns whether the given
symbol belongs to the interface. Check also constants now.
(ReadStableSymbols): Use IsInterfaceSymbol().
* bindings/scripts/test/GObject/WebKitDOMTestInterface.h:
* bindings/scripts/test/GObject/WebKitDOMTestObj.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170475 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Add padding for future expansion to WebKitDOMEventTargetIface
https://bugs.webkit.org/show_bug.cgi?id=134298

Reviewed by Martin Robinson.

* bindings/gobject/WebKitDOMEventTarget.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170476 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Mac] allow host application to canonicalize media urls
https://bugs.webkit.org/show_bug.cgi?id=134329

Reviewed by Dean Jackson.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::canonicalURL): New, use NSURLProtocol to canonicalize a URL.
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): Call canonicalURL.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170478 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][WK2] Fix Debug Build Error in Webcore module.
https://bugs.webkit.org/show_bug.cgi?id=134345

Patch by Shivakumar JM <shiva.jm@samsung.com> on 2014-06-26
Reviewed by Zalan Bujtas.

Use static cast to change the type of variable to fix error

* platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
(WebCore::HarfBuzzShaper::setDrawRange):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170479 268f45cc-cd09-0410-ab3c-d52691b4dbfc
DFG::FunctionWhitelist::parseFunctionNamesInFile does not close file
<http://webkit.org/b/134343>
<rdar://problem/17459487>

Reviewed by Michael Saboff.

* dfg/DFGFunctionWhitelist.cpp:
(JSC::DFG::FunctionWhitelist::parseFunctionNamesInFile):
Close the file handle, and log an error on failure.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170480 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Win] Unreviewed gardening. Use consistent line-endings in file.

* WinLauncher/WinLauncher.h: Use '\n' EOL marker, not DOS-style
'\r\n' EOL.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170481 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add an undo group for each dictated utterance in WebKit
https://bugs.webkit.org/show_bug.cgi?id=134086

Applied review comments from Sam Weinig.

Move the associated USE #define into Platform.h.

Source/WebCore: 
 
* WebCore.xcodeproj/project.pbxproj:
* editing/mac/TextUndoInsertionMarkup.h: Removed.
* editing/mac/TextUndoInsertionMarkupMac.h:

Source/WebKit2: 

* UIProcess/PageClient.h:

Source/WTF: 

* wtf/Platform.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170482 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Win] Expose Cache Information to WinLauncher
https://bugs.webkit.org/show_bug.cgi?id=134318

Reviewed by Dean Jackson.


Source/JavaScriptCore: 
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: Add missing
MemoryStatistics files to the WIndows build.
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:

Source/WebKit: 
* WebKit.vcxproj/WebKit/WebKitPostBuild.cmd: Copy the
CFDictionaryPropertyBag header to WebKit API directory.
* WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in:
Expose the dictionary accessor for the CFDictionaryPropertyBag.

Source/WebKit/win: 
* Interfaces/IWebCoreStatistics.idl: Add missing
API added to WebKit since this was last updated.
* WebCache.cpp:
(WebCache::statistics): Add missing elements for
purgable and purged data.
* WebCoreStatistics.cpp: Provide implementaions.
* WebCoreStatistics.h: Ditto.

Tools: 
* WinLauncher/Common.cpp: Update for new dialog.
* WinLauncher/WinLauncher.cpp: Add support for WebCache
and WebCoreStatistics.
* WinLauncher/WinLauncher.h:
* WinLauncher/WinLauncher.vcxproj/WinLauncherLib.rc:
Update for new Cache Dialog.
* WinLauncher/WinLauncher.vcxproj/WinLauncherLibCommon.props: Link to
WTF.lib
* WinLauncher/WinLauncher.vcxproj/WinLauncherLibResource.h: Update
for new Dialog.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170483 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[MSE] Refactoring: Differentiate between SampleMap decode and presentation order methods
https://bugs.webkit.org/show_bug.cgi?id=134349

Reviewed by Geoffrey Garen.

Refactor SampleMap to clarify the distinction between methods which return decode-order
iterators and ones which retun presentation-order iterators.

Add two classes, PresentationOrderSampleMap and DecodeOrderSampleMap, to contain the actual
MediaTime-to-Sample maps, and move the methods returning presentation-order and decode-order
iterators to each, respectively.  Rename the {presentation,decode}{Begin,End}() methods to
begin() and end() so the objects can be used in C++11 for-loops.

Update all the call sites in SourceBuffer to use the new ordered objects.

* Modules/mediasource/SampleMap.cpp:
(WebCore::SampleIsLessThanMediaTimeComparator::operator()): Use new ordered objects.
(WebCore::SampleIsGreaterThanMediaTimeComparator::operator()): Ditto.
(WebCore::SampleMap::clear): Ditto.
(WebCore::SampleMap::addSample): Ditto.
(WebCore::SampleMap::removeSample): Ditto.
(WebCore::PresentationOrderSampleMap::findSampleContainingPresentationTime): Renamed from SampleMap version.
(WebCore::PresentationOrderSampleMap::findSampleAfterPresentationTime): Ditto.
(WebCore::DecodeOrderSampleMap::findSampleWithDecodeTime): Ditto.
(WebCore::PresentationOrderSampleMap::reverseFindSampleContainingPresentationTime): Ditto.
(WebCore::PresentationOrderSampleMap::reverseFindSampleBeforePresentationTime): Ditto.
(WebCore::DecodeOrderSampleMap::reverseFindSampleWithDecodeTime): Ditto.
(WebCore::DecodeOrderSampleMap::findSyncSamplePriorToPresentationTime): Ditto.
(WebCore::DecodeOrderSampleMap::findSyncSamplePriorToDecodeIterator): Ditto.
(WebCore::DecodeOrderSampleMap::findSyncSampleAfterPresentationTime): Ditto.
(WebCore::DecodeOrderSampleMap::findSyncSampleAfterDecodeIterator): Ditto.
(WebCore::PresentationOrderSampleMap::findSamplesBetweenPresentationTimes): Ditto.
(WebCore::PresentationOrderSampleMap::findSamplesWithinPresentationRange): Ditto.
(WebCore::DecodeOrderSampleMap::findDependentSamples): Ditto.
* Modules/mediasource/SampleMap.h:
(WebCore::PresentationOrderSampleMap::begin): Renamed from presentationBegin().
(WebCore::PresentationOrderSampleMap::end): Renamed from presentationEnd().
(WebCore::PresentationOrderSampleMap::rbegin): Renamed from reversePresentationBegin().
(WebCore::PresentationOrderSampleMap::rend): Renamed from reversePresentationEnd().
(WebCore::DecodeOrderSampleMap::begin): Renamed from decodeBegin().
(WebCore::DecodeOrderSampleMap::end): Renamed from decodeEnd().
(WebCore::DecodeOrderSampleMap::rbegin): Renamed from reverseDecodeBegin().
(WebCore::DecodeOrderSampleMap::rend): Renamed from reverseDecodeEnd().
(WebCore::SampleMap::SampleMap): Create new ordered objects.
(WebCore::SampleMap::sizeInBytes): Use new ordered objects.
(WebCore::SampleMap::decodeOrder): Simple accessor.
(WebCore::SampleMap::presentationOrder): Simple accessor.
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::sourceBufferPrivateSeekToTime): Use new ordered objects.
(WebCore::SourceBuffer::sourceBufferPrivateFastSeekTimeForMediaTime): Ditto.
(WebCore::SourceBuffer::removeCodedFrames): Ditto.
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): Ditto.
(WebCore::SourceBuffer::bufferedSamplesForTrackID): Ditto.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170484 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS] no need to deactivate audio session
https://bugs.webkit.org/show_bug.cgi?id=134350

Reviewed by Jer Noble.

* platform/audio/mac/MediaSessionManagerMac.cpp:
(MediaSessionManager::updateSessionState): Don't bother calling 
    AudioSession::setActive(false), WebCore's audio session will be deactivated 
    automatically if another application begins playing audio.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed build-fix. Remove unintentionial rename of MediaTime.h -> MediaTimeHash.h.

* Modules/mediasource/SampleMap.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170486 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS]: Tapping <button> outside of a form is no longer working
https://bugs.webkit.org/show_bug.cgi?id=134319
<rdar://problem/17213346>

Reviewed by Daniel Bates.

Restore behavior of allowing <button> clicks outside of <form>.
This used to be iOS behavior before it was removed in favor of the
OpenSource (Android?) behavior. Now, willRespondToMouseClickEvents
is only used by iOS, so lets restore the iOS behavior.

* html/HTMLButtonElement.cpp:
(WebCore::HTMLButtonElement::willRespondToMouseClickEvents):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170487 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[MSE] Refactoring: Use C++11 for-loops in SourceBuffer.
https://bugs.webkit.org/show_bug.cgi?id=134352

Reviewed by Darin Adler.

Use C++11 style for-loops where appropriate in SourceBuffer now that the
SampleMap ordered objects support them.

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::sourceBufferPrivateSeekToTime):
(WebCore::SourceBuffer::sourceBufferPrivateFastSeekTimeForMediaTime):
(WebCore::SourceBuffer::sourceBufferPrivateAppendComplete):
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
(WebCore::SourceBuffer::validateInitializationSegment):
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170488 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove a useless return in WebPageProxyIOS

Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-06-26

* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::updateVisibleContentRects):
Darin caught this mistake in r170460.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170491 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Change the target membership of WKBackForwardListPrivate.h from WebKit2 to WebKit.

Rubber-stamped by Dan Bernstein.

* WebKit2.xcodeproj/project.pbxproj:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170492 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS] Add API for opting into character selection granularity
https://bugs.webkit.org/show_bug.cgi?id=134354

Reviewed by Geoff Garen.

* Shared/API/Cocoa/WKFoundation.h: Added a definition of WK_ENUM_AVAILABLE_IOS.
* UIProcess/API/Cocoa/WKWebViewConfiguration.h:
(WKSelectionGranularity): Added this enum with two values, one representing dynamic
granularity( the current, default behavior) and one representing character granularity.
Delcared new selectionGranularity property.
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration copyWithZone:]): Copy the _selectionGranularity ivar.

* UIProcess/ios/WKContentViewInteraction.mm:
(toUIWebSelectionMode): Added this helper function for mapping WKSelectionGranularity values
to UIWebSelectionMode values.
(-[WKContentView setupInteraction]): Use a selection assistant with the mode specified in
the configuration.
(-[WKContentView _stopAssistingKeyboard]): Ditto.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::selectWithGesture): Changed the behavior of the loupe gesture type in
non-editable text to select a word, rather than an empty range, matching the UITextView
behavior.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170495 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS] Remove User Default for iOS TextField Debugging
https://bugs.webkit.org/show_bug.cgi?id=134356

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2014-06-26
Reviewed by Timothy Hatcher.

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebView.mm:
(-[WebView initSimpleHTMLDocumentWithStyle:frame:preferences:groupName:]):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170496 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Command-/ (slash) now auto-comments code via CodeMirror 4. Should remove as command to pause
https://bugs.webkit.org/show_bug.cgi?id=134313

Reviewed by Timothy Hatcher.

Changed alternate command to pause/resume from command-slash to command-backslash.
Command-slash sets/unsets comments in all code editors.

* UserInterface/Models/KeyboardShortcut.js: Added Backslash.
* UserInterface/Views/DebuggerSidebarPanel.js: Changed pauseOrResumeAlternateKeyboardShortcut to use Backslash instead of Slash.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170497 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Define TARGET_OS_IPHONE to 0 for non-darwin ports
https://bugs.webkit.org/show_bug.cgi?id=134347

Reviewed by Darin Adler.

A follow-up to r169880 to make it easier to reason about
the code. The purpose of this change to allow
"#if TARGET_OS_IPHONE" in public header files.

* wtf/Platform.h:


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