Add an argument to ImageSource::createFrameAtIndex to hint a decoder that we expect a scaled image.
https://bugs.webkit.org/show_bug.cgi?id=121696

Patch by Yongjun Zhang <yongjun_zhang@apple.com> on 2013-09-20
Reviewed by Antti Koivisto.

Add an argument to ImageSource::createFrameAtIndex.  A platform image decoder can decide the optimal
scale based on the hint and pass the real scale it used for decoding.

No new tests, no behavior change.

* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::createFrameAtIndex):
* platform/graphics/ImageSource.h:
* platform/graphics/cg/ImageSourceCG.cpp:
(WebCore::ImageSource::createFrameAtIndex):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156195 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-[WebHTMLConveter _getFloat:forNode:property:] leaks
https://bugs.webkit.org/show_bug.cgi?id=121709

Reviewed by Enrica Casucci.

* platform/mac/HTMLConverter.mm:
(-[WebHTMLConverter _getFloat:forNode:property:]): Don't leak.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156196 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move logicalHeightForLine out of LineWidth.h
https://bugs.webkit.org/show_bug.cgi?id=121575

Reviewed by David Hyatt.

In bug #121107 (r155565), I moved logicalHeightForLine into LineWidth.h as part of LineWidth
refactoring. LogicalHeightForLine without passing the second parameter uses RenderBlock::lineHeight
anyway, except it doesn't take -line-box-contain CSS property into account. For Shapes we don't
have implementation for variable-height lines (https://bugs.webkit.org/show_bug.cgi?id=95361) yet, so
so I modified the affected functions to call lineHeight directly. I renamed logicalHeightForLine
to minLineHeightForReplacedRenderer, and I made the second parameter a mandatory for that function.

No new tests, no behavior change.

* rendering/LineWidth.cpp:
(WebCore::LineWidth::updateAvailableWidth):
(WebCore::LineWidth::shrinkAvailableWidthForNewFloatIfNeeded):
* rendering/LineWidth.h:
* rendering/RenderBlock.cpp: Move the definition here.
(WebCore::RenderBlock::minLineHeightForReplacedRenderer):
* rendering/RenderBlock.h: Move the function here and rename it.
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlock::layoutShapeInsideInfo):
(WebCore::updateLogicalInlinePositions):
(WebCore::updateSegmentsForShapes):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156197 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Fix keyboard shortcuts for other platforms
https://bugs.webkit.org/show_bug.cgi?id=120657

Patch by Marcelo Morais <m.morais@samsung.com> on 2013-09-20
Reviewed by Timothy Hatcher.

Handling keyboard shortcuts according to the current platform.

* UserInterface/InspectorFrontendHostStub.js:
(.WebInspector.InspectorFrontendHostStub.prototype.loadResourceSynchronously):
(.WebInspector.InspectorFrontendHostStub.prototype.platform): Added. Return the
current platform.
* UserInterface/KeyboardShortcut.js:
(WebInspector.KeyboardShortcut.Modifier.get CommandOrControl): Added. Created keyboard
modifier to return Control or Command key according to current platform.
* UserInterface/ContentBrowser.js:
(WebInspector.ContentBrowser): Returning Control or Command key for keyboard
shortcuts according to current platform.
* UserInterface/DebuggerSidebarPanel.js:
(WebInspector.DebuggerSidebarPanel): Ditto.
* UserInterface/FindBanner.js:
(WebInspector.FindBanner): Ditto.
* UserInterface/JavaScriptLogViewController.js:
(WebInspector.JavaScriptLogViewController): Ditto.
* UserInterface/LogContentView.js:
(WebInspector.LogContentView): Ditto.
* UserInterface/Main.js:
(WebInspector.contentLoaded): Ditto.
* UserInterface/ResourceSidebarPanel.js:
(WebInspector.ResourceSidebarPanel): Ditto.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156198 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Refactoring LineBreaker and RenderTextInfo out of RenderBlock.h
https://bugs.webkit.org/show_bug.cgi?id=121707

Reviewed by David Hyatt.

LineBreaker and RenderTextInfo are defined in RenderBlock.h, but only used in RenderBlockLineLayout.cpp.
Moving them there (LineBreaker needs to be a friend class of RenderBlock) in the first step in the process
of refactoring LineBreaker::NextSegmentBreak into more manageable chunks.

This change was reviewed and landed in Blink:
https://src.chromium.org/viewvc/blink?revision=157402&view=revision

No new tests.

* rendering/RenderBlock.h:
* rendering/RenderBlockLineLayout.cpp:
(WebCore::LineBreaker::LineBreaker):
(WebCore::LineBreaker::lineWasHyphenated):
(WebCore::LineBreaker::positionedObjects):
(WebCore::LineBreaker::clear):
(WebCore::RenderTextInfo::RenderTextInfo):
(WebCore::RenderTextInfo::~RenderTextInfo):
(WebCore::LineBreaker::skipTrailingWhitespace):
(WebCore::LineBreaker::skipLeadingWhitespace):
(WebCore::LineBreaker::reset):
(WebCore::LineBreaker::nextLineBreak):
(WebCore::LineBreaker::nextSegmentBreak):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156199 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Ensure that TileController tile coverage is updated on scrolling even when we don't have scrollbars
https://bugs.webkit.org/show_bug.cgi?id=121700
<rdar://problem/15030589>

Reviewed by Dean Jackson.

r155660 introduced a bug where we wouldn't make scrollbars on long pages. However,
that revealed a fundamental flaw in the TiledBacking update logic; it relied on the
GraphicsLayer flushes triggered by scrollbars updates in order to update the main
TileController's tile coverage. No scrollbars meant no tile coverage updates.

Fix by explicitly triggering a flush when the FrameView is scrolled (we get
notified about this on the main thread after the scrolling thread has moved
layers around).

No test since this will only be exposed for a short time while scrollbars are
broken.

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::frameViewDidScroll):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156200 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Scrollbars don't appear on long pages after r155660
https://bugs.webkit.org/show_bug.cgi?id=121714
<rdar://problem/15042478>

Reviewed by Beth Dakin.

After r155660, we don't do any additional layouts when scrollbars are
added or removed. That caused us to not enter the code that creates or
destroys composting layers for scrollbars in RenderLayerCompositor, resulting
in missing scrollbars.

Fix by having ScrollView::updateScrollbars() call addedOrRemovedScrollbar()
when a scrollbar was added or removed, which is overridden in FrameView
to call through to RenderLayerCompositor::frameViewDidAddOrRemoveScrollbars().

Not testable since scrollbar layers aren't contained in layer tree dumps
(to reduce diffs between platforms).

* page/FrameView.cpp:
(WebCore::FrameView::addedOrRemovedScrollbar): New function to tell the compositor
that scrollbars changed.
* page/FrameView.h:
* platform/ScrollView.cpp:
(WebCore::ScrollView::setHasHorizontalScrollbar): Change the meaning of the return
value to say if the scrollbar was added or removed. Add an out param that indicates
whether the scrollbar change affects content size (not true for overlay scrollbars).
(WebCore::ScrollView::setHasVerticalScrollbar): Ditto.
(WebCore::ScrollView::updateScrollbars): Keep track of whether scrollbars were
added or removed, and call addedOrRemovedScrollbar() if true.
* platform/ScrollView.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::frameViewDidAddOrRemoveScrollbars): Call updateOverflowControlsLayers().
(WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
* rendering/RenderLayerCompositor.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156201 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[ATK] Do not expose aria-help in ATK based platforms
https://bugs.webkit.org/show_bug.cgi?id=121675

Patch by Mario Sanchez Prada <mario.prada@samsung.com> on 2013-09-20
Reviewed by Chris Fleizach.

Source/WebCore:

Stop exposing the value for the 'aria-help' attribute as an
AtkObject attribute, based in AccessibilityObject::helpText().

* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(webkitAccessibleGetAttributes): Remove the mapping.

Source/WebKit/efl:

Removed accessibilityHelpText() helper method from
DumpRenderSupportEfl's API, since it's not longer needed.

* WebCoreSupport/DumpRenderTreeSupportEfl.cpp: Removed method.
* WebCoreSupport/DumpRenderTreeSupportEfl.h: Ditto.

Source/WebKit/gtk:

Removed accessibilityHelpText() helper method from
DumpRenderSupportGtk's API, since it's not longer needed.

* WebCoreSupport/DumpRenderTreeSupportGtk.cpp: Removed method.
* WebCoreSupport/DumpRenderTreeSupportGtk.h: Ditto.

Tools:

Remove the implementations for AccessibilityUIElement::helpText()
from DRT and WKTR for GTK and EFL, since they are based on the
AccessibilityObject::helpText() method and the 'aria-help'
attributes, which is wrong since they should not depend on that
but in ATK specific API (see also http://webkit.org/b/121684).

* DumpRenderTree/atk/AccessibilityUIElementAtk.cpp:
(AccessibilityUIElement::helpText): Added a new and empty
implementation, now that we are no longer using this in ATK.
* DumpRenderTree/efl/AccessibilityUIElementEfl.cpp: Removed file
as the only function provided here was helpText().
* DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp: Ditto.
* DumpRenderTree/efl/CMakeLists.txt: AccessibilityUIElementEfl.cpp
removed from the list of sources to compile.
* GNUmakefile.am: Likewise, but for AccessibilityUIElementGtk.cpp.
* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(WTR::AccessibilityUIElement::helpText): Replaced old implementation
based in DumpRenderTreeSupportGtk with an empty one.

LayoutTests:

Moved test based in helpText() into the Mac directory, and update
expectations for platforms as needed.

* platform/mac/accessibility/aria-help-expected.txt: Renamed from LayoutTests/accessibility/aria-help-expected.txt.
* platform/mac/accessibility/aria-help.html: Renamed from LayoutTests/accessibility/aria-help.html.
* platform/gtk-wk2/TestExpectations: Removed failure expectation
for aria-help, now moved to Mac, and for aria-describedby-on-input,
which is now moved to the generic TestExpectations file for GTK.
* platform/gtk/TestExpectations: Added aria-describedby-on-input,
linking it to the newly filed bug 121684.
* platform/gtk-wk2/TestExpectations: Removed failure expectation.
* platform/win/TestExpectations: Removed failure expectation.
* platform/wincairo/TestExpectations: Ditto.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156203 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add an implementation of std::index_sequence from C++14
https://bugs.webkit.org/show_bug.cgi?id=121718

Reviewed by Ryosuke Niwa.

This will make it easier to do things like pack expansion of tuple elements.

* wtf/StdLibExtras.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156204 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Shaders that fail to compile should be marked as such
https://bugs.webkit.org/show_bug.cgi?id=121721

Reviewed by Simon Fraser.

1. Add a new logging channel for WebGL.

2. If a translated shader fails to compile (technically
this should never happen), mark it as invalid.

Test: https://www.khronos.org/registry/webgl/sdk/tests/conformance/glsl/misc/shader-with-non-reserved-words.html

* platform/Logging.h: New WebGL channel.
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::compileShader): Log the raw and translated
input to glCompileShader, but mark the entry as invalid.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156205 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<https://webkit.org/b/90090> build-webkit should verify that your tools are up-to-date

Tools:

Enforce a minimum OS version of 10.7.5 and Xcode version of 4.6.

Reviewed by David Kilzer.

* Scripts/webkitdirs.pm:
(checkRequiredSystemConfig):

Websites/webkit.org:

Update references on webkit.org to mention Xcode 4.6 as the minimum version.

Reviewed by David Kilzer.

* building/debug-mac-uiprocess.html:
* building/tools.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156208 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Parse MIME-types and strip them down to the base type when needed.

The use of charset in a MIME-type interferes with our type maps,
preventing the right syntax highlighting mode and pretty printing.

https://bugs.webkit.org/show_bug.cgi?id=121723

Reviewed by Joseph Pecoraro.

* UserInterface/ConsolePrompt.js:
(WebInspector.ConsolePrompt):
* UserInterface/FontResourceContentView.js:
* UserInterface/Resource.js:
(WebInspector.Resource.Type.fromMIMEType):
(WebInspector.Resource.prototype.get mimeTypeComponents):
(WebInspector.Resource.prototype.get syntheticMIMEType):
(WebInspector.Resource.prototype.get contentURL):
(WebInspector.Resource.prototype.updateForResponse):
* UserInterface/ResourceDetailsSidebarPanel.js:
(WebInspector.ResourceDetailsSidebarPanel.prototype._refreshRequestDataSection):
* UserInterface/SourceMapResource.js:
(WebInspector.SourceMapResource.prototype.requestContentFromBackend):
* UserInterface/SyntaxHighlightingSupport.js:
(WebInspector.syntaxHighlightStringAsDocumentFragment):
* UserInterface/TextEditor.js:
(WebInspector.TextEditor.prototype.set mimeType):
* UserInterface/Utilities.js:
(parseMIMEType): Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156209 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r156185.
http://trac.webkit.org/changeset/156185
https://bugs.webkit.org/show_bug.cgi?id=121727

Caused a lot of crashes in tests (Requested by ap on #webkit).

Source/WebCore:

* dom/Document.cpp:
(WebCore::Document::Document):
(WebCore::Document::recalcStyle):
(WebCore::Document::updateLayout):
* dom/Document.h:

LayoutTests:

* fast/dom/HTMLDocument/active-element-gets-unfocusable-expected.txt: Removed.
* fast/dom/HTMLDocument/active-element-gets-unfocusable.html: Removed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156210 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r153215): New iCloud site crashes
https://bugs.webkit.org/show_bug.cgi?id=121710

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

Don't claim to be able to rely on the arguments structure, use the Arguments
speculation type

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::::executeEffects):

LayoutTests:

New test case

* js/dfg-arguments-mutated-structure-expected.txt: Added.
* js/dfg-arguments-mutated-structure.html: Added.
* js/script-tests/dfg-arguments-mutated-structure.js: Added.
(foo):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156211 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r156047): WebCore hangs inside JSC::toInt32(double)
https://bugs.webkit.org/show_bug.cgi?id=121648

Source/JavaScriptCore: 

Reviewed by Mark Hahnenberg.
        
The Int52<->StrictInt52 conversion did the opposite fill() than what it was
supposed to. For example when converting a Int52 to a StrictInt52 it would fill
as Int52, and vice-versa.

* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::fillSpeculateInt52):

LayoutTests: 

Reviewed by Mark Hahnenberg.

* js/dfg-int52-change-format-expected.txt: Added.
* js/dfg-int52-change-format.html: Added.
* js/script-tests/dfg-int52-change-format.js: Added.
(foo):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156212 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix test after <http://trac.webkit.org/changeset/156203>

* platform/mac/accessibility/aria-help.html: Correct paths to JS tests.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156213 268f45cc-cd09-0410-ab3c-d52691b4dbfc
(un)shiftCountWithAnyIndexingType will start over in the middle of copying if it sees a hole
https://bugs.webkit.org/show_bug.cgi?id=121717

Reviewed by Oliver Hunt.

Source/JavaScriptCore:

This bug caused the array to become corrupted. We now check for holes before we start moving things,
and start moving things only once we've determined that there are none.

* runtime/JSArray.cpp:
(JSC::JSArray::shiftCountWithAnyIndexingType):
(JSC::JSArray::unshiftCountWithAnyIndexingType):

LayoutTests:

Added test to make sure that splicing an array with holes works correctly.

* js/array-splice-with-holes-expected.txt: Added.
* js/array-splice-with-holes.html: Added.
* js/script-tests/array-splice-with-holes.js: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156214 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: [CSS Regions] Display CSS Regions chain when highlighting a CSS Region node
https://bugs.webkit.org/show_bug.cgi?id=121719

Reviewed by Joseph Pecoraro.

Source/WebCore:

Test: inspector/elements/highlight-node-regions.html

When a CSS Region node is highlighted through the WebInspector, it will also lookup all the regions
that are part of the same flow and inject enough information into InspectorOverlayPage.js to get the other
CSS Regions highlighted as well. A chain will also link the regions and a number will display the ordering
of the content.

* WebCore.exp.in:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::buildObjectForHighlightedNode):
* inspector/InspectorController.h:
* inspector/InspectorOverlay.cpp:
(WebCore::buildObjectForRegionHighlight):
(WebCore::buildObjectForCSSRegionsHighlight):
(WebCore::InspectorOverlay::buildObjectForHighlightedNode):
(WebCore::InspectorOverlay::drawNodeHighlight): Separated the InspectorObject building part out of this function,
so that we can call buildObjectForHighlightedNode from the Internals APIs for testing.
* inspector/InspectorOverlay.h:
* inspector/InspectorOverlayPage.js:
(_drawRegionNumber):
(_quadMidPoint):
(_drawRegionLink):
(_fixQuadScrollPosition):
(_drawRegionsHighlight):
(drawNodeHighlight):
* testing/Internals.cpp: Exposed the generated InspectorObject to the layout test.
(WebCore::Internals::inspectorHighlightObject):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

Added test to check the position of the CSS Regions part of the same flow thread with
the highlighted CSS Region node.

* http/tests/inspector/elements-test.js:
* inspector/elements/highlight-node-regions-expected.txt: Added.
* inspector/elements/highlight-node-regions.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156215 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WINDOWS] Unreviewed build fix after r156215.
   * WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in:
   Add missing symbols needed by DumpRenderTree.dll.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156216 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Windows] Unreviewed build fix after r156216.

        * WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in: I
        accidentally exposed the symbol of the calling function, not
        the missing symbol!


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