Removed a defunct comment
https://bugs.webkit.org/show_bug.cgi?id=113948

Reviewed by Oliver Hunt.

This is also a convenient way to test the EWS.

* bytecompiler/BytecodeGenerator.cpp:
(JSC):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147669 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Exception stack unwinding doesn't handle inline callframes correctly
https://bugs.webkit.org/show_bug.cgi?id=113952

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

The basic problem here is that the exception stack unwinding was
attempting to be "clever" and avoid doing a correct stack walk
as it "knew" inline callframes couldn't have exception handlers.

This used to be safe as the exception handling machinery was
designed to fail gently and just claim that no handler existed.
This was "safe" and even "correct" inasmuch as we currently
don't run any code with exception handlers through the dfg.

This patch fixes the logic by simply making everything uniformly
use the safe stack walking machinery, and making the correct
boundary checks occur everywhere that they should.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::findClosureCallForReturnPC):
(JSC::CodeBlock::bytecodeOffset):
* interpreter/Interpreter.cpp:
(JSC):
(JSC::Interpreter::dumpRegisters):
(JSC::Interpreter::unwindCallFrame):
(JSC::getCallerInfo):
(JSC::Interpreter::getStackTrace):
(JSC::Interpreter::retrieveCallerFromVMCode):

LayoutTests:

Yay tests!

* fast/js/js-correct-exception-handler-expected.txt: Added.
* fast/js/js-correct-exception-handler.html: Added.
* fast/js/script-tests/js-correct-exception-handler.js: Added.
(throwEventually):
(f.g):
(f):
(test):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147670 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        REGRESSION (r146580): Assertion using SecurityOrigin::create, URL string is not valid
        https://bugs.webkit.org/show_bug.cgi?id=113961

        Reviewed by Geoff Garen.

        * page/SecurityOrigin.cpp:
        (WebCore::SecurityOrigin::createFromDatabaseIdentifier):
        (WebCore::SecurityOrigin::create):
        Don't use ParsedURLString, because http://host:80/ is normalized to http://host/,
        so it's not a parsed URL string.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147671 268f45cc-cd09-0410-ab3c-d52691b4dbfc
turn off running tests on chromium linux EWS bots
https://bugs.webkit.org/show_bug.cgi?id=113959

Reviewed by Geoffrey Garen.

Now that the Chromium port is no longer being maintained
there's little point in running the tests. Soon we should
just shut this bot off altogether.

* Scripts/webkitpy/tool/commands/earlywarningsystem.py:
(ChromiumLinuxEWS):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147672 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Unreviewed gardening. Rebaseline after r147588. Update pixel expectations.

* platform/efl-wk1/fast/text/international/003-expected.png: Added.
* platform/efl-wk1/fast/text/international/text-combine-image-test-expected.png: Added.
* platform/efl-wk1/fast/writing-mode/Kusa-Makura-background-canvas-expected.png: Added.
* platform/efl-wk2/fast/text/international/003-expected.png: Added.
* platform/efl-wk2/fast/text/international/text-combine-image-test-expected.png: Added.
* platform/efl-wk2/fast/writing-mode/Kusa-Makura-background-canvas-expected.png: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147673 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Unreviewed gardening. Rebaseline after r147588. Remove overridden pixel results.

* platform/efl/fast/text/international/003-expected.png: Removed.
* platform/efl/fast/text/international/text-combine-image-test-expected.png: Removed.
* platform/efl/fast/writing-mode/Kusa-Makura-background-canvas-expected.png: Removed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147674 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Mac] add "automatic" text track menu item
https://bugs.webkit.org/show_bug.cgi?id=113822

Reviewed by Jer Noble.

Source/WebCore: 

No new tests, existing tests updated.

* English.lproj/Localizable.strings: Add new track menu item.

* html/HTMLMediaElement.cpp: 
(WebCore::HTMLMediaElement::HTMLMediaElement): Initialize m_captionDisplayMode.
(WebCore::HTMLMediaElement::finishParsingChildren): LoadTextTrackResource -> ConfigureTextTracks.
(WebCore::HTMLMediaElement::scheduleDelayedAction): Ditto.
(WebCore::HTMLMediaElement::loadTimerFired): Ditto.
(WebCore::HTMLMediaElement::loadInternal): Ditto. Flag the caption menu as invalid so it will
    be rebuilt again.
(WebCore::HTMLMediaElement::mediaPlayerDidAddTrack): LoadTextTrackResource -> ConfigureTextTracks.
(WebCore::HTMLMediaElement::didAddTrack): Ditto.
(WebCore::HTMLMediaElement::configureTextTrackGroup): Deal with new track display modes.
(WebCore::HTMLMediaElement::HTMLMediaElement::hasClosedCaptions): Minor cleanup.
(WebCore::HTMLMediaElement::configureTextTrackGroup): Add some logging.
(WebCore::HTMLMediaElement::configureTextTracks): Call updateActiveTextTrackCues so cue display
    is updated.
(WebCore::HTMLMediaElement::captionPreferencesChanged): Deal with new track display modes.
(WebCore::HTMLMediaElement::markCaptionAndSubtitleTracksAsUnconfigured): Add some logging.
* html/HTMLMediaElement.h: Ditto.

* html/shadow/MediaControlElementTypes.cpp: Remove trackIndexAttributeName and trackListIndexForElement.
* html/shadow/MediaControlElementTypes.h: Ditto.

* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlClosedCaptionsTrackListElement::defaultEventHandler): Don't use track index,
    everything we need is in the track<->element map now.
(WebCore::MediaControlClosedCaptionsTrackListElement::updateDisplay): Ditto. Always rebuild the 
    track list because clear the map each time the menu goes away because it refs every track.
(WebCore::MediaControlClosedCaptionsTrackListElement::rebuildTrackListMenu): Don't set the track
    index attribute on the menu items, just use the map.
* html/shadow/MediaControlElements.h:

* html/shadow/MediaControlsApple.cpp:
(WebCore::MediaControlsApple::changedClosedCaptionsVisibility): resetTrackListMenu is gone.
(WebCore::MediaControlsApple::reset): Ditto.
(WebCore::MediaControlsApple::closedCaptionTracksChanged): Ditto.

* html/track/TextTrack.cpp:
(WebCore::TextTrack::captionMenuOffItem): New, static TextTrack used for the menu "Off" item.
(WebCore::TextTrack::captionMenuAutomaticItem): New, static TextTrack used for the menu "Automatic" item.
* html/track/TextTrack.h:

* page/CaptionUserPreferences.cpp:
(WebCore::CaptionUserPreferences::shouldShowCaptions): Removed, we use captionDisplayMode instead.
(WebCore::CaptionUserPreferences::captionDisplayMode): New.
(WebCore::CaptionUserPreferences::setCaptionDisplayMode): New.
(WebCore::CaptionUserPreferences::setPreferredLanguage): Make the parameter a const reference.
(WebCore::CaptionUserPreferences::textTrackSelectionScore): Return 0 if the user doesn't want
    captions or subtitles.
(WebCore::CaptionUserPreferences::textTrackLanguageSelectionScore): Take language as a parameter
    instead of assuming that it is always the entire language list.
* page/CaptionUserPreferences.h:

* page/CaptionUserPreferencesMac.h:
* page/CaptionUserPreferencesMac.mm:
(WebCore::CaptionUserPreferencesMac::shouldShowCaptions): Removed, we use captionDisplayMode instead.
(WebCore::CaptionUserPreferencesMac::captionDisplayMode): New.
(WebCore::CaptionUserPreferencesMac::setCaptionDisplayMode): New.
(WebCore::CaptionUserPreferencesMac::setPreferredLanguage): Make the parameter a const reference.
(WebCore::CaptionUserPreferencesMac::textTrackSelectionScore): Deal with "Automatic" mode.
    captions or subtitles.
(WebCore::CaptionUserPreferences::textTrackLanguageSelectionScore): Take language as a parameter
    instead of assuming that it is always the entire language list.
(WebCore::CaptionUserPreferencesMac::sortedTrackListForMenu): Insert "Off" and "Automatic" items.

* platform/LocalizedStrings.cpp:
(WebCore::textTrackAutomaticMenuItemText): New.
* platform/LocalizedStrings.h:

* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::languageOfPrimaryAudioTrack): New.
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerPrivate.h:

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack): Return the language
    of the main audio track.

LayoutTests: 

* media/media-captions.html: Opportunistic fix - don't look at state until we get the 'canplaythrough'
    event because the media engine state may not have been processed until that time.
* media/track/track-cue-container-rendering-position.html: Don't assume that a cue has been 
    rendered immediately when the 'canplaythrough' event comes through.
* media/track/track-cue-rendering-mode-changed.html: Ditto.
* media/track/track-in-band-expected.txt: Don't check if cues have loaded, it doesn't matter
    for this test.
* media/track/track-in-band.html: Ditto.
* media/track/track-user-preferences-expected.txt: Changed name of utility function from 
    menuIndexForLanguage to indexOfMenuItemBeginningWith.
* media/track/track-user-preferences.html: Move menuIndexForLanguage to trackmenu-test.js and
    change name to indexOfMenuItemBeginningWith. Clarify the message logged when a track loads
    but it should not.
* media/trackmenu-test.js: Move some functions here from track-user-preferences.html
(trackMenuList):
(indexOfMenuItemBeginningWith):
(selectCaptionMenuItem):
* media/video-controls-captions-trackmenu-sorted.html: Update for new menu item.
* media/video-controls-captions-trackmenu.html: Ditto.
* platform/mac/media/video-controls-captions-trackmenu-expected.txt: Ditto.
* platform/mac/media/video-controls-captions-trackmenu-sorted-expected.txt: Ditto.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147675 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make fast/events/tabindex-focus-blur-all.html disallow Java so the test runs the same regardless of platform/port
https://bugs.webkit.org/show_bug.cgi?id=113950

Patch by Dave Michael <dmichael@chromium.org> on 2013-04-04
Reviewed by Jer Noble.

This hopefully fixes the test failure seen on Apple Mountain Lion WK2:
http://build.webkit.org/results/Apple%20MountainLion%20Release%20WK2%20(Tests)/r147640%20(7636)/results.html
that was introduced in https://bugs.webkit.org/show_bug.cgi?id=32292

* fast/events/resources/tabindex-focus-blur-all.js: Make the test disallow Java execution. Otherwise, <applet> is focusible on platforms that support Java by default and not focusible elsewhere.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147676 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Stop pretending that statements return a value
https://bugs.webkit.org/show_bug.cgi?id=113969

Reviewed by Oliver Hunt.

Expressions have an intrinsic value, which they return to their parent
in the AST.

Statements just execute for effect in sequence.

This patch moves emitBytecode into the ExpressionNode and StatementNode
subclasses, and changes the SatementNode subclass to return void. This
eliminates some cruft where we used to return 0, or try to save a bogus
register and return it, as if a statement had a consuming parent in the
AST.

* bytecompiler/BytecodeGenerator.h:
(JSC::BytecodeGenerator::emitNode):
(BytecodeGenerator):
(JSC::BytecodeGenerator::emitNodeInConditionContext):
* bytecompiler/NodesCodegen.cpp:
(JSC::ConstStatementNode::emitBytecode):
(JSC::BlockNode::emitBytecode):
(JSC::EmptyStatementNode::emitBytecode):
(JSC::DebuggerStatementNode::emitBytecode):
(JSC::ExprStatementNode::emitBytecode):
(JSC::VarStatementNode::emitBytecode):
(JSC::IfNode::emitBytecode):
(JSC::IfElseNode::emitBytecode):
(JSC::DoWhileNode::emitBytecode):
(JSC::WhileNode::emitBytecode):
(JSC::ForNode::emitBytecode):
(JSC::ForInNode::emitBytecode):
(JSC::ContinueNode::emitBytecode):
(JSC::BreakNode::emitBytecode):
(JSC::ReturnNode::emitBytecode):
(JSC::WithNode::emitBytecode):
(JSC::CaseClauseNode::emitBytecode):
(JSC::CaseBlockNode::emitBytecodeForBlock):
(JSC::SwitchNode::emitBytecode):
(JSC::LabelNode::emitBytecode):
(JSC::ThrowNode::emitBytecode):
(JSC::TryNode::emitBytecode):
(JSC::ScopeNode::emitStatementsBytecode):
(JSC::ProgramNode::emitBytecode):
(JSC::EvalNode::emitBytecode):
(JSC::FunctionBodyNode::emitBytecode):
(JSC::FuncDeclNode::emitBytecode):
* parser/NodeConstructors.h:
(JSC::PropertyListNode::PropertyListNode):
(JSC::ArgumentListNode::ArgumentListNode):
* parser/Nodes.h:
(Node):
(ExpressionNode):
(StatementNode):
(ConstStatementNode):
(BlockNode):
(EmptyStatementNode):
(DebuggerStatementNode):
(ExprStatementNode):
(VarStatementNode):
(IfNode):
(IfElseNode):
(DoWhileNode):
(WhileNode):
(ForNode):
(ForInNode):
(ContinueNode):
(BreakNode):
(ReturnNode):
(WithNode):
(LabelNode):
(ThrowNode):
(TryNode):
(ProgramNode):
(EvalNode):
(FunctionBodyNode):
(FuncDeclNode):
(CaseBlockNode):
(SwitchNode):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147677 268f45cc-cd09-0410-ab3c-d52691b4dbfc
The commit queue should use Mac MountainLion port
https://bugs.webkit.org/show_bug.cgi?id=113971

Reviewed by Lucas Forschler.

* EWSTools/setup-commit-queue.sh: Copied from Tools/EWSTools/GoogleComputeEngine/build-commit-queue.sh.
* Scripts/webkitpy/tool/commands/queues.py:
(CommitQueue):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147678 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, fix a test and some results missed in r147675

* media/media-captions-expected.txt:
* 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@147679 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix webkitpy tests after r147678.

* Scripts/webkitpy/tool/commands/queues_unittest.py:
(CommitQueueTest.test_commit_queue):
(test_manual_reject_during_processing):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147680 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Regression(r147639) Causes assertion hit in HashTable
https://bugs.webkit.org/show_bug.cgi?id=113954

Reviewed by Benjamin Poulain.

Lookup the key in the hash table again after the recursive call to
getCachedFontPlatformData() as it may have altered the hash map and
invalidated the previous iterator we had.

No new tests, covered by existing tests.

* platform/graphics/FontCache.cpp:
(WebCore::FontCache::getCachedFontPlatformData):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Page content missing when flipping from an empty layer to a tiled layer
https://bugs.webkit.org/show_bug.cgi?id=113977
<rdar://problem/13444219>

Source/WebCore:

Reviewed by Tim Horton.

Some articles on USA Today were missing content on load, when a large GraphicsLayer
which did not draw content needed to draw content (and become tiled in the process).

The bug was an ordering dependency in GraphicsLayerCA::commitLayerChangesBeforeSublayers().
swapFromOrToTiledLayer() sets some dirty flags, but for some properties which have
already been committed in the current flush cycle.

Fix by moving the swapFromOrToTiledLayer() to the top of the commit, which is
safe since it only consults GraphicsLayer properties, not CALayer properties.

Test: compositing/tiling/empty-to-tiled.html

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
(WebCore::GraphicsLayerCA::updateGeometry):
(WebCore::GraphicsLayerCA::updateLayerDrawsContent):
(WebCore::GraphicsLayerCA::updateContentsScale):
* platform/graphics/ca/GraphicsLayerCA.h:
(GraphicsLayerCA):

LayoutTests:

Reviewed by Tim Horton.

Ref test that adds visible content to a larger layer.

* compositing/tiling/empty-to-tiled-expected.html: Added.
* compositing/tiling/empty-to-tiled.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147682 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Cairo] Stop passing raw pointers to BitmapImage::create()
https://bugs.webkit.org/show_bug.cgi?id=113945

Reviewed by Martin Robinson.

Source/WebCore:

BitmapImage::create() was updated in r147643 to take a PassRefPtr<cairo_surface_t>
in argument instead of a cairo_surface_t*. This patch updates several call sites
so that they now pass in a smart pointer instead of a raw one to avoid silent
converting from cairo_surface_t* to PassRefPtr<cairo_surface_t>.

No new tests, no behavior change.

* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::ImageBufferData::ImageBufferData): Use RefPtr to m_surface to avoid manual
memory handling.
(WebCore::ImageBuffer::ImageBuffer):
(WebCore::ImageBuffer::~ImageBuffer):
(WebCore::ImageBuffer::copyImage):
(WebCore::ImageBuffer::clip):
(WebCore::ImageBuffer::platformTransformColorSpace):
(WebCore::getImageData):
(WebCore::ImageBuffer::putByteArray):
* platform/graphics/cairo/ImageBufferDataCairo.h:
(ImageBufferData):
* platform/graphics/gstreamer/ImageGStreamerCairo.cpp:
(ImageGStreamer::ImageGStreamer):
* platform/graphics/gtk/ImageBufferGtk.cpp:
(WebCore::ImageBuffer::toDataURL):

Source/WebKit2:

Pass a smart pointer in to BitmapImage::create() instead of a raw one
for the cairo surface. The factory method prototype was updated for
cairo in r147643.

* Shared/cairo/ShareableBitmapCairo.cpp:
(WebKit::ShareableBitmap::createImage):

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