[Mac] user caption styles not applied to correct element
https://bugs.webkit.org/show_bug.cgi?id=114230

Reviewed by Jer Noble.

Source/WebCore: 

Test: media/track/track-css-user-override.html

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::updateActiveTextTrackCues): Drive by clean-up so we don't log excessively.

* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTextTrackContainerElement::MediaControlTextTrackContainerElement): Initialize
    new member variables.
(WebCore::MediaControlTextTrackContainerElement::updateDisplay): Set cue font size when it is
    inserted into the tree.
(WebCore::MediaControlTextTrackContainerElement::updateTimerFired): Update the font size of 
    all active cues.
(WebCore::MediaControlTextTrackContainerElement::updateSizes): Set size-relative CSS properties
    after a time because this can be called during layout.
* html/shadow/MediaControlElements.h:

* html/shadow/MediaControls.cpp:
(WebCore::MediaControls::textTrackPreferencesChanged): Call closedCaptionTracksChanged before updateSizes.

* html/track/TextTrackCue.cpp:
(WebCore::TextTrackCue::setFontSize): New, set the cue's font size.
* html/track/TextTrackCue.h:

* html/track/TextTrackCueGeneric.cpp:
(WebCore::TextTrackCueGenericBoxElement::applyCSSProperties): Set cue properties on the cue element
    instead of on the cue box to match what we do for the "cue" pseudo element.
(WebCore::TextTrackCueGeneric::setFontSize): New, set the cue's font size.
* html/track/TextTrackCueGeneric.h:

* html/track/TextTrackList.cpp:
(TextTrackList::remove): Drive-by cleanup, don't ASSERT when the media element is NULL.

* page/CaptionUserPreferences.cpp:
(WebCore::CaptionUserPreferences::setCaptionsStyleSheetOverride): New, allow user CSS overrides
    to be tested in DRT.
(WebCore::CaptionUserPreferences::updateCaptionStyleSheetOveride): New, generate a user style
    sheet override. Moved here from CaptionUserPreferencesMac.
* page/CaptionUserPreferences.h:

* page/CaptionUserPreferencesMac.h:
* page/CaptionUserPreferencesMac.mm:
(WebCore::CaptionUserPreferencesMac::captionsBackgroundCSS): Don't ignore background color importance.
(WebCore::CaptionUserPreferencesMac::captionsStyleSheetOverride): Implement even when we don't 
    have the media accessibility framework so this can be tested in DRT. Apply all cue properties
    to the element used for the "cue" pseudo element.

* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::didLoadingProgress): Drive-by cleanup, remove logging
    because this method is called so frequently and the logging is not especially useful.
(WebCore::MediaPlayerPrivateAVFoundation::updateStates): Only log when the ready/network
    state changes because this method is called so frequently.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::platformLayer): Drive-by cleanup, remove logging
    because this method is called so frequently and the logging is not especially useful.
(WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTrack): Make the logging more useful.

* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState): Reset captions style sheet override.
(WebCore::Internals::captionsStyleSheetOverride): New, return the captions style sheet override.
(WebCore::Internals::setCaptionsStyleSheetOverride): New, override the captions style sheet override.
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests: 

* media/track/track-css-user-override-expected.txt: Added.
* media/track/track-css-user-override.html: Added.
* media/track/track-cue-container-rendering-position-expected.txt:
* media/track/track-cue-container-rendering-position.html:
* media/track/track-cue-rendering-expected.txt:
* media/track/track-cue-rendering.html: Font size is not applied instantly when a video element is
    resized, so check after a very short delay.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148050 268f45cc-cd09-0410-ab3c-d52691b4dbfc
webkitbot refers to sheriffbot in help
https://bugs.webkit.org/show_bug.cgi?id=114307

Reviewed by Benjamin Poulain.

Fixed the bug by proxying the IRC nickname of "sheriffbot" via Sheriff object.

* Scripts/webkitpy/tool/bot/irc_command.py:
(Help):
(Help.execute):
(RollChromiumDEPS.execute):
* Scripts/webkitpy/tool/bot/ircbot_unittest.py:
(IRCBotTest.test_help):
* Scripts/webkitpy/tool/bot/sheriff.py:
(Sheriff.name):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148051 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[wk2] IconDatabase images should be decoded in the WebProcess
​https://bugs.webkit.org/show_bug.cgi?id=112524
<rdar://problem/10133914>

Reviewed by Simon Fraser.

Move an ASSERT that dereferenced a pointer inside the null-check for that pointer.

* loader/icon/IconDatabase.cpp:
(WebCore::IconDatabase::setIconBitmapForIconURL):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148052 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, fix the Windows build after r148050.

* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTextTrackContainerElement::updateTimerFired): Use lround().


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148053 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION (r147454): Youtube annotation links to new window broken
https://bugs.webkit.org/show_bug.cgi?id=114242
<rdar://problem/13609940>

Reviewed by Beth Dakin.

Set the current user gesture to "DefinitelyProcessingNewUserGesture" if popups are allowed.

* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::performFrameLoadURLRequest):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148054 268f45cc-cd09-0410-ab3c-d52691b4dbfc
newcommitbot (WKR) requires a subversion checkout
https://bugs.webkit.org/show_bug.cgi?id=114309

Reviewed by Benjamin Poulain.

Directly talk to the subversion server instead of relying on a local checkout.
This allows us to run WKR off of a git clone.

* Scripts/webkitpy/tool/commands/newcommitbot.py:
(NewCommitBot.next_work_item):
(NewCommitBot.process_work_item):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148055 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Exclusions] Properly position multiple stacked floats with non rectangular shape outside
https://bugs.webkit.org/show_bug.cgi?id=110372

Patch by Bem Jones-Bey <bjonesbe@adobe.com> on 2013-04-09
Reviewed by Dean Jackson.

Source/WebCore:

Stacked floats get positioned based on the bounding box of the shape,
not on the shape contours itself. This patch causes that to happen.

Test: fast/exclusions/shape-outside-floats/shape-outside-floats-stacked.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::computeLogicalLocationForFloat): Use the
    "BoundingBoxOffset" mode so that we compute offsets based on the shape
    bounding boxes of previous floats, not the shape contour.
(WebCore::RenderBlock::logicalLeftOffsetForLine): Check the
    ShapeOutsideFloatOffsetMode to determine if the offset should be
    adjusted for the shape contour or not.
(WebCore::RenderBlock::logicalRightOffsetForLine): Ditto.
* rendering/RenderBlock.h:
(WebCore::RenderBlock::logicalRightOffsetForLine): Add parameter for offset mode.
(WebCore::RenderBlock::logicalLeftOffsetForLine): Ditto.
(RenderBlock):
* rendering/RenderBlockLineLayout.cpp:
(WebCore::LineWidth::shrinkAvailableWidthForNewFloatIfNeeded): If the
    new float is being added on top of a previous float on the same line,
    undo the offset for the previous float's shape contour so that we
    position the new float based on the bounding box.

LayoutTests:

Tests demonstrating stacked floats properly working with shape-outside.

* fast/exclusions/shape-outside-floats/shape-outside-floats-stacked-expected.html: Added.
* fast/exclusions/shape-outside-floats/shape-outside-floats-stacked.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148056 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rebaseline tests affected by r148049 or r148048.

* compositing/layer-creation/rotate3d-overlap-expected.txt:
* compositing/repaint/resize-repaint-expected.txt:
* compositing/repaint/resize-repaint.html: Allow the test to run
outside WTR/DRT.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148057 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, another fix for the Windows build after r148050.

* html/track/TextTrackCueGeneric.cpp:
(WebCore::TextTrackCueGeneric::setFontSize): Use lround().


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148058 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r148010.
http://trac.webkit.org/changeset/148010
https://bugs.webkit.org/show_bug.cgi?id=114310

Causes problems with focus rings (Requested by anttik on
#webkit).


Source/WebCore:

* css/StyleBuilder.cpp:
(WebCore::ApplyPropertyComputeLength::applyValue):
(WebCore::ApplyPropertyComputeLength::createHandler):
(WebCore::StyleBuilder::StyleBuilder):

LayoutTests:

* fast/borders/border-width-less-then-a-unit-of-pt-expected.html: Removed.
* fast/borders/border-width-less-then-a-unit-of-pt.html: Removed.
* platform/gtk/TestExpectations:
* platform/mac/TestExpectations:
* platform/qt/tables/mozilla_expected_failures/bugs/bug89315-expected.png:
* platform/qt/tables/mozilla_expected_failures/bugs/bug89315-expected.txt:
* tables/mozilla_expected_failures/bugs/bug89315-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148059 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Change requisite hardware checks for enabling antialiasing.
https://bugs.webkit.org/show_bug.cgi?id=114101
<rdar://problem/12342776>.

m_maySupportMultisampling should be true by default for all platforms/hardware now except older versions of AMD.

Reviewed by Dean Jackson.

* platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
(WebCore::Extensions3DOpenGLCommon::Extensions3DOpenGLCommon):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148060 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed correctness fix: use lroundf instead of lround for a float to int conversion.

* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTextTrackContainerElement::updateTimerFired):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add liveness tests to JSC API entry points
https://bugs.webkit.org/show_bug.cgi?id=114318

Reviewed by Filip Pizlo.

Add simple checks for the existence of a method table on any
JSCells passed across the API.  This in turn forces a structure
validity test.

* API/APICast.h:
(toJS):
(toJSForGC):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148062 268f45cc-cd09-0410-ab3c-d52691b4dbfc
AX: Bounding paths should be made available through accessibility
https://bugs.webkit.org/show_bug.cgi?id=113817

Unreviewed build fix for iOS.

* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper _accessibilityPath]):
* accessibility/mac/WebAccessibilityObjectWrapperBase.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148063 268f45cc-cd09-0410-ab3c-d52691b4dbfc
hang in mediaSelectionGroupForMediaCharacteristic
https://bugs.webkit.org/show_bug.cgi?id=114054

Reviewed by Eric Carlson.

No new tests; Fixes sporadic hangs in media/ tests.

-[AVURLAsset mediaSelectionGroupForMediaCharacteristic:] can deadlock in certain situations: When AVURLAsset
posts a synchronous AVAssetResourceLoader notification to the main thread, calling -mediaSelectionGroupForMediaCharacteristic:
on the main thread requires IO to occur if the media characteristics are not yet loaded. Instead of blocking,
bail out early if the media characteristics are not yet known.

Add a new method, safeMediaSelectionGroupForLegibleMedia(), which first checks selection group availability
before calling mediaSelectionGroupForMediaCharacteristic:.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
(MediaPlayerPrivateAVFoundationObjC):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForLegibleMedia): Added.
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem): Use new safe method.
(WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged): Ditto.
(WebCore::MediaPlayerPrivateAVFoundationObjC::processTextTracks): Ditto.
(WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTrack): Ditto.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148064 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION (r123837): Full screen transition is broken at apple.com
https://bugs.webkit.org/show_bug.cgi?id=95650

Reviewed by Simon Fraser.

Cancel any outstanding animations on <video> elements as they enter full screen, so as to
not confuse the WebKit/WebKit2 full screen window animation about the starting and destination
screen rects.

* css/fullscreen.css:
(video:-webkit-full-screen, audio:-webkit-full-screen):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148065 268f45cc-cd09-0410-ab3c-d52691b4dbfc
r148048 revealed that compositing/plugins/invalidate_rect.html was
only succeeded through chance, and cannot work as designed because
plugin painting is async on some platforms. Mark it as flakey.

* platform/mac/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148066 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rollout last patch as it destroyed everything

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148067 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        REGRESSION: Blob URLs broken with NetworkProcess
        https://bugs.webkit.org/show_bug.cgi?id=114320

        Reviewed by Brady Eidson.

        Update BlobResourceHandle to use modern resource client calls.

        * platform/network/BlobResourceHandle.cpp:
        (WebCore::BlobResourceHandle::readSync): Don't call notifyReceiveData if there is
        no data (it's especially egregious when length is -1, signaling an error).
        (WebCore::BlobResourceHandle::notifyResponseOnSuccess): Use didReceiveResponseAsync
        when a client wants async callbacks. This is not very clean, as we don't wait
        for response, but should be workable for blobs.
        (WebCore::BlobResourceHandle::notifyResponseOnError): Ditto.
        (WebCore::BlobResourceHandle::notifyReceiveData): Use didReceiveBuffer (clients
        that only implement didReceiveData will have it automatically unwrapped).



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148068 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK][AC] Adding contentsLayer for image and video
https://bugs.webkit.org/show_bug.cgi?id=113912

Reviewed by Gustavo Noronha Silva.

contentsLayer is a ClutterActor, which is added to the main layer
as a child when GraphicsLayer needs to render an image or video.

No new tests, already covered by existing AC tests.

* platform/graphics/clutter/GraphicsLayerActor.cpp:
(graphicsLayerActorUpdateTexture):
* platform/graphics/clutter/GraphicsLayerClutter.cpp:
(WebCore::GraphicsLayerClutter::GraphicsLayerClutter):
(WebCore::GraphicsLayerClutter::~GraphicsLayerClutter):
(WebCore):
(WebCore::GraphicsLayerClutter::setContentsToImage): Pass a Cairo surface to GraphicsLayer.
(WebCore::GraphicsLayerClutter::setContentsNeedsDisplay):
(WebCore::GraphicsLayerClutter::setContentsRect):
(WebCore::GraphicsLayerClutter::commitLayerChangesBeforeSublayers):
(WebCore::GraphicsLayerClutter::setupContentsLayer):
(WebCore::GraphicsLayerClutter::updateContentsImage): Set the Cairo surface for contentsLayer
to upload it as a texture.
(WebCore::GraphicsLayerClutter::updateContentsNeedsDisplay):
(WebCore::GraphicsLayerClutter::updateContentsRect):
(WebCore::GraphicsLayerClutter::updateSublayerList):
* platform/graphics/clutter/GraphicsLayerClutter.h:
(WebCore::GraphicsLayerClutter::hasContentsLayer):
(GraphicsLayerClutter):
(WebCore::GraphicsLayerClutter::contentsLayer):


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