Support C++11 static_assert
https://bugs.webkit.org/show_bug.cgi?id=113308

Reviewed by Alexey Proskuryakov.

Use the C++11 static_assert for COMPILE_ASSERT when it is available. Note that
even when compiling with C++11 support, static_assert will not always be available
since Assertions.h may also be used outside of C++.

C11 _Static_assert is enabled for GCC when it has C11 support (gcc>=4.7 -std=c11).

* wtf/Assertions.h:
* wtf/Compiler.h:

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

Addressing layout test failures that are specific to GTK-WK1 by moving the related expectations into the specific
TestExpectations file or adjusting and moving the baselines into the GTK-WK1 baseline search path.

* platform/gtk-wk1/TestExpectations:
* platform/gtk-wk1/fast: Added.
* platform/gtk-wk1/fast/media: Added.
* platform/gtk-wk1/fast/media/mq-transform-02-expected.html: Copied from LayoutTests/platform/gtk/fast/media/mq-transform-02-expected.html.
* platform/gtk-wk1/fast/media/mq-transform-03-expected.html: Copied from LayoutTests/platform/gtk/fast/media/mq-transform-03-expected.html.
* platform/gtk-wk2/TestExpectations:
* platform/gtk/TestExpectations:
* platform/gtk/fast/dom/HTMLLinkElement/prefetch-expected.txt: Added.
* platform/gtk/fast/dom/HTMLLinkElement/subresource-expected.txt: Added.
* platform/gtk/fast/hidpi/clip-text-in-hidpi-expected.txt:
* platform/gtk/fast/hidpi/image-set-background-dynamic-expected.txt:
* platform/gtk/fast/hidpi/image-set-border-image-dynamic-expected.txt:
* platform/gtk/fast/media/mq-transform-02-expected.html: Removed.
* platform/gtk/fast/media/mq-transform-03-expected.html: Removed.
* platform/gtk/fast/preloader: Added.
* platform/gtk/fast/preloader/document-write-2-expected.txt: Added.
* platform/gtk/fast/preloader/document-write-expected.txt: Added.
* platform/gtk/fast/preloader/script-expected.txt: Added.
* platform/gtk/http/tests/security/XFrameOptions: Removed.
* platform/gtk/http/tests/security/XFrameOptions/x-frame-options-allowall-expected.txt: Removed.
* platform/gtk/http/tests/security/XFrameOptions/x-frame-options-invalid-expected.txt: Removed.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146994 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Mac] Use fontName rather than familyName for internal fonts
https://bugs.webkit.org/show_bug.cgi?id=113392
<rdar://problem/13474743>

Reviewed by Enrica Casucci.

Some internal fonts on OS X have a family name that
isn't listed in availableFontFamilies. In this case
we should use the font name rather than the family
name when looking for a match.

* platform/mac/ThemeMac.h: NSFont category to provide a web-friendly family name.
* platform/mac/ThemeMac.mm:
(-[NSFont webCoreFamilyName]): Returns the font name for internal fonts, otherwise the family name.
(WebCore::ThemeMac::controlFont):
* rendering/RenderThemeMacShared.mm: Use the webCoreFamilyName.
(WebCore::RenderThemeMacShared::systemFont): Ditto.
(WebCore::RenderThemeMacShared::setFontFromControlSize): Ditto.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146995 268f45cc-cd09-0410-ab3c-d52691b4dbfc
DFG should use CheckStructure for typed array checks whenever possible
https://bugs.webkit.org/show_bug.cgi?id=113374

Reviewed by Geoffrey Garen.
        
We used to do the right thing, but it appears that this regressed at some point. Since the
FixupPhase now has the ability to outright remove spurious CheckStructures on array
operations, it is profitable for the ByteCodeParser to insert CheckStructures whenver there
is a chance that it might be profitable, and when the profiling tells us what structure to
check.
        
Also added some code for doing ArrayProfile debugging.
        
This is a slightly speed-up. Maybe 3% on Mandreel.

* bytecode/ArrayProfile.cpp:
(JSC::ArrayProfile::computeUpdatedPrediction):
* dfg/DFGArrayMode.h:
(JSC::DFG::ArrayMode::benefitsFromStructureCheck):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146996 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add a performance tests for selecting all content in a document
https://bugs.webkit.org/show_bug.cgi?id=113358

Reviewed by Levi Weintraub.

Add a performance test for selecting all. We wait for paint to happen by setTimeout(~, 0).

Example outputs:
    RESULT Interactive: SelectAll: Time= 652.6 ms
    median= 644.5 ms, stdev= 54.6177144967 ms, min= 599.0 ms, max= 773.0 ms

    RESULT Interactive: SelectAll: Time= 654.4 ms
    median= 633.5 ms, stdev= 55.9223145368 ms, min= 600.0 ms, max= 769.0 ms

    RESULT Interactive: SelectAll: Time= 657.9 ms
    median= 640.0 ms, stdev= 54.1420159833 ms, min= 604.0 ms, max= 774.0 ms

* Interactive/SelectAll.html: Added.
* Skipped:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146997 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK][webkitpy] A huge list of warnings about missing bugs in expectations when running NRWT with WKTR
https://bugs.webkit.org/show_bug.cgi?id=113421

Reviewed by Dirk Pranke.

When running the layout tests with WKTR through NRWT, the GTK port also uses the generic WK2 TestExpectations file.
This file contains a large amount of expectations that are not listing a specific bug modifier, so this produces an
equally large amount of warnings due to the GTK port preferring for every expectation to have the bug modifier present
in the GTK-specific TestExpectations files.

To avoid this only enable the warnings only when not using WKTR.

* Scripts/webkitpy/layout_tests/port/gtk.py:
(GtkPort.warn_if_bug_missing_in_test_expectations):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146998 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Inserting a blank (" ") at the end of a line does not insert anything in Overtype mode
https://bugs.webkit.org/show_bug.cgi?id=113413

Reviewed by Ryosuke Niwa.

Source/WebCore:

Perform a "normal" insert instead of a replace when there is
nothing to replace (like at the end of a line) as this case is not
supported by the replacing code path. This will allow us to
properly rebalance whitespaces in those cases.

Updated the editing/execCommand/overtype.html test to check also
this use case.

* editing/InsertTextCommand.cpp:
(WebCore::InsertTextCommand::setEndingSelectionWithoutValidation):
(WebCore::InsertTextCommand::performTrivialReplace):
(WebCore::InsertTextCommand::performOverwrite):
(WebCore::InsertTextCommand::doApply): use the recently added
setEndingSelectionWithoutValidation() to avoid code duplication.
* editing/InsertTextCommand.h:
(InsertTextCommand):

LayoutTests:

Updated the test to include the case of inserting a whitespace
both in the middle or at the end of a line.

* editing/execCommand/overtype-expected.txt:
* editing/execCommand/overtype.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146999 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Mac] Text track menu items sometimes labeled incorrectly
https://bugs.webkit.org/show_bug.cgi?id=113406

Reviewed by Jer Noble.

Source/WebCore: 

media/video-controls-captions-trackmenu-localized.html was updated to test this.

* page/CaptionUserPreferencesMac.mm:
(WebCore::trackDisplayName): Use the 'label' attribute for the menu text when necessary.

LayoutTests: 

* media/video-controls-captions-trackmenu-localized.html:
* platform/mac/media/video-controls-captions-trackmenu-localized-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147000 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Mac] webkitClosedCaptionsVisible doesn't work
https://bugs.webkit.org/show_bug.cgi?id=113417

Reviewed by Jer Noble.

Source/WebCore: 

Test: media/track/track-in-band-legacy-api.html

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement): Delete m_disableCaptions, it is no longer used.
(WebCore::HTMLMediaElement::configureTextTrackGroup): Pass this to textTrackSelectionScore.
(WebCore::HTMLMediaElement::setClosedCaptionsVisible):  Delete m_disableCaptions, it is no longer used.
* html/HTMLMediaElement.h: Ditto.

* page/CaptionUserPreferences.cpp:
(WebCore::CaptionUserPreferences::textTrackSelectionScore): Add an HTMLMediaElement parameter.
* page/CaptionUserPreferences.h:

* page/CaptionUserPreferencesMac.h:
* page/CaptionUserPreferencesMac.mm:
(WebCore::CaptionUserPreferencesMac::textTrackSelectionScore): Return a score if the media element
    is showing captions, even if the preference says captions are disabled.

LayoutTests: 

* media/track/track-in-band-legacy-api-expected.txt: Added.
* media/track/track-in-band-legacy-api.html: Added.

* platform/chromium/TestExpectations: Skip new test.
* platform/efl/TestExpectations: Ditto.
* platform/gtk/TestExpectations: Ditto.
* platform/mac/TestExpectations: Ditto.
* platform/qt/TestExpectations: Ditto.
* platform/win/TestExpectations: Ditto.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147001 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed GTK gardening. Rebaselining after r146992.

* platform/gtk/fast/hidpi/video-controls-in-hidpi-expected.txt:
* platform/gtk/fast/layers/video-layer-expected.txt:
* platform/gtk/media/audio-controls-rendering-expected.txt:
* platform/gtk/media/audio-repaint-expected.txt:
* platform/gtk/media/controls-after-reload-expected.txt:
* platform/gtk/media/controls-strict-expected.txt:
* platform/gtk/media/controls-styling-strict-expected.txt:
* platform/gtk/media/controls-without-preload-expected.txt:
* platform/gtk/media/video-controls-rendering-expected.txt:
* platform/gtk/media/video-display-toggle-expected.txt:
* platform/gtk/media/video-empty-source-expected.txt:
* platform/gtk/media/video-no-audio-expected.txt:
* platform/gtk/media/video-playing-and-pause-expected.txt:
* platform/gtk/media/video-volume-slider-expected.txt:
* platform/gtk/media/video-zoom-controls-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147002 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Updated Slovenian translation
https://bugs.webkit.org/show_bug.cgi?id=113151

Patch by Matej Urbančič <mateju@svn.gnome.org> on 2013-03-27
Reviewed by Gustavo Noronha Silva (kov).

* sl.po: translation update.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147003 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add support for dock-to-right of the Web Inspector in the Mac port.

Unfortunately this requires Safari changes, so it is disabled in the nightly builds.

https://webkit.org/b/113341
rdar://problem/10368152

Reviewed by Joseph Pecoraro.

.:

* Source/autotools/symbols.filter:

Source/WebCore:

* WebCore.exp.in:
* inspector/InspectorFrontendClient.h:
(InspectorFrontendClient):
* inspector/InspectorFrontendClientLocal.cpp:
(WebCore):
(WebCore::InspectorFrontendClientLocal::frontendLoaded):
(WebCore::InspectorFrontendClientLocal::requestSetDockSide):
(WebCore::InspectorFrontendClientLocal::canAttachWindow):
(WebCore::InspectorFrontendClientLocal::changeAttachedWindowWidth):
(WebCore::InspectorFrontendClientLocal::setAttachedWindow):
(WebCore::InspectorFrontendClientLocal::constrainedAttachedWindowWidth):
* inspector/InspectorFrontendClientLocal.h:
(InspectorFrontendClientLocal):
* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::setAttachedWindowWidth):
(WebCore):
* inspector/InspectorFrontendHost.h:
(InspectorFrontendHost):
* inspector/InspectorFrontendHost.idl:
* inspector/front-end/InspectorFrontendHostStub.js:
(.WebInspector.InspectorFrontendHostStub.prototype.setAttachedWindowWidth):
* inspector/front-end/externs.js:
(InspectorFrontendHostAPI.prototype.setAttachedWindowWidth):
* testing/Internals.cpp:

Source/WebKit/chromium:

* src/InspectorFrontendClientImpl.cpp:
(WebKit::InspectorFrontendClientImpl::changeAttachedWindowWidth):
* src/InspectorFrontendClientImpl.h:
(InspectorFrontendClientImpl):

Source/WebKit/efl:

* WebCoreSupport/InspectorClientEfl.cpp:
(WebCore::InspectorFrontendClientEfl::attachWindow):
(WebCore::InspectorFrontendClientEfl::setAttachedWindowWidth):
* WebCoreSupport/InspectorClientEfl.h:
(InspectorFrontendClientEfl):

Source/WebKit/gtk:

* WebCoreSupport/InspectorClientGtk.cpp:
(WebKit::InspectorFrontendClient::attachWindow):
(WebKit::InspectorFrontendClient::setAttachedWindowWidth):
* WebCoreSupport/InspectorClientGtk.h:
(InspectorFrontendClient):

Source/WebKit/mac:

* Resources/Dock.pdf: Updated.
* WebCoreSupport/WebInspectorClient.h:
(WebInspectorFrontendClient):
* WebCoreSupport/WebInspectorClient.mm:
(WebInspectorFrontendClient::frontendLoaded):
(WebInspectorFrontendClient::attachWindow):
(WebInspectorFrontendClient::setAttachedWindowWidth):
(-[WebInspectorWindowController attachWindow:]):
(-[WebInspectorWindowController attach]):
(-[WebInspectorWindowController detach]):
* WebInspector/WebInspectorFrontend.mm:
(-[WebInspectorFrontend attach]):

Source/WebKit/qt:

* WebCoreSupport/InspectorClientQt.cpp:
(WebCore::InspectorFrontendClientQt::frontendLoaded):
(WebCore::InspectorFrontendClientQt::attachWindow):
(WebCore::InspectorFrontendClientQt::setAttachedWindowWidth):
* WebCoreSupport/InspectorClientQt.h:
(InspectorFrontendClientQt):

Source/WebKit/win:

* WebCoreSupport/WebInspectorClient.cpp:
(WebInspectorFrontendClient::frontendLoaded):
(WebInspectorFrontendClient::attachWindow):
(WebInspectorFrontendClient::setAttachedWindowWidth):
* WebCoreSupport/WebInspectorClient.h:
(WebInspectorFrontendClient):

Source/WebKit2:

* Resources/Dock.pdf: Removed.
* Resources/DockBottom.pdf: Added.
* Resources/DockRight.pdf: Added.
* Shared/WebPreferencesStore.h:
* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::WebInspectorProxy):
(WebKit::WebInspectorProxy::attachBottom):
(WebKit::WebInspectorProxy::attachRight):
(WebKit::WebInspectorProxy::attach):
(WebKit::WebInspectorProxy::detach):
(WebKit::WebInspectorProxy::setAttachedWindowWidth):
(WebKit::WebInspectorProxy::createInspectorPage):
(WebKit::WebInspectorProxy::canAttach):
* UIProcess/WebInspectorProxy.h:
(WebInspectorProxy):
* UIProcess/WebInspectorProxy.messages.in:
* UIProcess/mac/WebInspectorProxyMac.mm:
(-[WKWebInspectorProxyObjCAdapter attachRight:]):
(-[WKWebInspectorProxyObjCAdapter attachBottom:]):
(-[WKWebInspectorWindow _cursorForResizeDirection:]):
(-[WKWebInspectorWindow _customTitleFrame]):
(WebKit::createDockButton):
(WebKit::WebInspectorProxy::createInspectorWindow):
(WebKit::WebInspectorProxy::platformCreateInspectorPage):
(WebKit::WebInspectorProxy::platformAttachAvailabilityChanged):
(WebKit::WebInspectorProxy::inspectedViewFrameDidChange):
(WebKit::WebInspectorProxy::platformInspectedWindowWidth):
(WebKit::WebInspectorProxy::platformAttach):
(WebKit::WebInspectorProxy::platformDetach):
(WebKit::WebInspectorProxy::platformSetAttachedWindowHeight):
(WebKit::WebInspectorProxy::platformSetAttachedWindowWidth):
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp:
(WebKit::WebInspectorFrontendClient::attachWindow):
(WebKit::WebInspectorFrontendClient::setAttachedWindowWidth):
* WebProcess/WebCoreSupport/WebInspectorFrontendClient.h:
(WebInspectorFrontendClient):
* WebProcess/WebPage/WebInspector.cpp:
(WebKit::WebInspector::attachBottom):
(WebKit::WebInspector::attachRight):
(WebKit::WebInspector::setAttachedWindowWidth):
(WebKit::WebInspector::attachedBottom):
(WebKit::WebInspector::attachedRight):
(WebKit::WebInspector::detached):
* WebProcess/WebPage/WebInspector.h:
(WebInspector):
* WebProcess/WebPage/WebInspector.messages.in:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147004 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add missing images from my previous commit.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147005 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Mem mapped resource data improvements.
<rdar://problem/13196481> and https://bugs.webkit.org/show_bug.cgi?id=113422

Reviewed by Alexey Proskuryakov (and looked over by Geoff Garen).

Remove timer-based approach support code:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::NetworkResourceLoader):
(WebKit::NetworkResourceLoader::abortInProgressLoad):
(WebKit::NetworkResourceLoader::didFinishLoading):
* NetworkProcess/NetworkResourceLoader.h:

Add an object to encapsulate monitoring a resource going in to the disk cache.
It listens for a callback on the cached response indicating it is disk backed
and also sets a timeout so we don't keep the monitor alive and waiting forever.
* NetworkProcess/mac/DiskCacheMonitor.h: Added.
(WebKit::DiskCacheMonitor::destinationID):
(WebKit::DiskCacheMonitor::connectionToWebProcess):
(WebKit::DiskCacheMonitor::resourceRequest):
* NetworkProcess/mac/DiskCacheMonitor.mm: Added.
(CFCachedURLResponseSetBecameFileBackedCallBackBlock):
(WebKit::monitorFileBackingStoreCreation):
(WebKit::DiskCacheMonitor::DiskCachingMonitor):
(WebKit::DiskCacheMonitor::connection):

Refactoring and monitor certain cached responses:
* NetworkProcess/mac/NetworkResourceLoaderMac.mm:
(CFCachedURLResponseGetMemMappedData):
(WebKit::NetworkResourceLoader::tryGetShareableHandleFromCFURLCachedResponse): Use CFCachedURLResponseGetMemMappedData
  to explicitly get an mem-mapped data object.
(WebKit::NetworkResourceLoader::tryGetShareableHandleForResource):
(WebKit::NetworkResourceLoader::willCacheResponseAsync): If the resource is over the minimum
  size then set up a disk caching monitor.

* WebKit2.xcodeproj/project.pbxproj:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147006 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Windows build fix attempt.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147007 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Selection code spends a lot of time in InlineTextBox::localSelectionRect
https://bugs.webkit.org/show_bug.cgi?id=113364

Reviewed by Enrica Casucci.

Avoid computing the font width when we're selecting the entire line box.

This appears to be 25-26% improvement on Interactive/SelectAll:Time.

* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::localSelectionRect):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147008 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Another Windows build fix attempt after r147004.

* WebKit.vcproj/WebKitExports.def.in:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147009 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Blind attempt at fixing the release build.

* NetworkProcess/mac/NetworkResourceLoaderMac.mm:
(WebKit::NetworkResourceLoader::willCacheResponseAsync):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147010 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Build fix after r146852. Please another reference to the Lion leaks builder.

* BuildSlaveSupport/build.webkit.org-config/config.json:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147011 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Chromium Mac fails to build after r146995 because the new NSFont category
may conflict with the system. Add the WebCoreTheme category to the whitelist.

Unreviewed.

* WebCore.gyp/WebCore.gyp:

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