Source/WebCore: [WebGL] Correct uniform input validation for texture sampler uniform
https://bugs.webkit.org/show_bug.cgi?id=126775

Reviewed by Dean Jackson.

Added fast/canvas/webgl/uniform-samplers-test.html

* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::uniform1iv): Access Int32Array data properly.

LayoutTests: [WebGL] Correct uniform input validation for texture sampler uniforms.
https://bugs.webkit.org/show_bug.cgi?id=126775

Reviewed by Dean Jackson.

* fast/canvas/webgl/uniform-samplers-test.html: Add a test that
shows that we can set sampler uniforms using Int32Array types.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161684 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS] Fix project build order

Ensure we build WebKitAdditions before WebCore (if applicable). Also, we don't
build WebInspectorUI, Tools/MiniBrowser, or Tools/WebKitTestRunner on iOS at the
time of writing.

* Scripts/build-webkit:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161685 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(C stack work): stack traces no longer work in CrashTracer, lldb, and other tools
https://bugs.webkit.org/show_bug.cgi?id=126764

Reviewed by Geoffrey Garen.

Updated callToJavaScript and cllToNativeFunction to properly replicate the caller's
return PC and frame pointer in the sentinel frame.  For X86-64, added .cfi_
directives to create eh_frame info for all LLInt symbols so that the various
unwinding code understands that we are using a separate JS stack referenced
by BP and at what offsets in that frame the prior PC (register 16) and prior
BP (register 6) can be found.  These two changes are sufficient for stack tracing
to work for Mac OSX.

* llint/LowLevelInterpreter.cpp:
* llint/LowLevelInterpreter64.asm:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161686 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: cycle clicked breakpoints between enabled, auto-continue, and disabled
https://bugs.webkit.org/show_bug.cgi?id=126669

Reviewed by Joseph Pecoraro.

It's time-consuming to change a breakpoint's auto-continue setting through the
breakpoint editor popup. This patch enables the user to toggle between enabled,
auto-continue, and disabled by clicking on the breakpoint wedge in the sidebar
tree and in the source text editor gutter. The auto-continue option is only
cycled when the breakpoint has associated actions.

Clean up the breakpoint editor dialog so it hides irrelevant options when
no breakpoint actions have been added.

Automatically unset auto-continue when the last breakpoint action is removed.

Rename the delegate textEditorBreakpointToggled to textEditorBreakpointClicked, since
the behavior of the click depends on breakpoint state not available in the text editor.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Breakpoint.js:
(WebInspector.Breakpoint.prototype.cycleToNextMode): Added.
(WebInspector.Breakpoint.prototype.toggleAutoContinue): Added.
(WebInspector.Breakpoint.prototype.appendContextMenuItems): Add auto-continue options.
(WebInspector.Breakpoint.prototype.removeAction):

(WebInspector.Breakpoint.prototype._editBreakpointPopoverContentElement):
(WebInspector.Breakpoint.prototype._popoverActionsAddActionButtonClicked):
(WebInspector.Breakpoint.prototype.breakpointActionViewAppendActionView):
(WebInspector.Breakpoint.prototype.breakpointActionViewRemoveActionView):
(WebInspector.Breakpoint.prototype.willDismissPopover):
* UserInterface/BreakpointTreeElement.css:
(.item.breakpoint .status > .status-image.auto-continue):
(.item.breakpoint .status > .status-image.disabled):
* UserInterface/BreakpointTreeElement.js:
(WebInspector.BreakpointTreeElement):
(WebInspector.BreakpointTreeElement.prototype.onenter):
(WebInspector.BreakpointTreeElement.prototype.onspace):
(WebInspector.BreakpointTreeElement.prototype._updateStatus):
(WebInspector.BreakpointTreeElement.prototype._breakpointLocationDidChange):
(WebInspector.BreakpointTreeElement.prototype._statusImageElementClicked):
* UserInterface/SourceCodeTextEditor.js:
(WebInspector.SourceCodeTextEditor):
(WebInspector.SourceCodeTextEditor.prototype.close):
(WebInspector.SourceCodeTextEditor.prototype._breakpointInfoForBreakpoint):
(WebInspector.SourceCodeTextEditor.prototype.textEditorBreakpointClicked):
* UserInterface/TextEditor.css:
(.text-editor > .CodeMirror .breakpoint-auto-continue:not(.breakpoint-disabled) .CodeMirror-linenumber::before):
* UserInterface/TextEditor.js:
(WebInspector.TextEditor.prototype._setBreakpointStylesOnLine.updateStyles):
(WebInspector.TextEditor.prototype._setBreakpointStylesOnLine):
(WebInspector.TextEditor.prototype.updateStyles):
(WebInspector.TextEditor.prototype._removeBreakpointFromLineAndColumn):
(WebInspector.TextEditor.prototype._documentMouseUp):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161687 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Implement OES texture half float linear
https://bugs.webkit.org/show_bug.cgi?id=125060

Reviewed by Brent Fulgham.

Source/WebCore:

Test: fast/canvas/webgl/oes-texture-half-float-linear.html

* CMakeLists.txt: Add new files.
* DerivedSources.cpp: Ditto.
* DerivedSources.make: Generate new file from IDL.
* GNUmakefile.list.am: Add new files.
* WebCore.vcxproj/WebCore.vcxproj: Ditto.
* WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
* WebCore.xcodeproj/project.pbxproj: New files for OESTextureHalfFloatLinear.

* bindings/js/JSWebGLRenderingContextCustom.cpp:
(WebCore::toJS): Map from extension name to native object.

* html/canvas/OESTextureHalfFloatLinear.cpp: Added. New files. These are boiler-plate.
* html/canvas/OESTextureHalfFloatLinear.h: Added.
* html/canvas/OESTextureHalfFloatLinear.idl: Added.

* html/canvas/WebGLExtension.h: Add new enum for the new extension.

* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::getExtension): Create the extension object if the
context is asked for one.
(WebCore::WebGLRenderingContext::getSupportedExtensions): Add the new extension to the
list of supported extensions. Actually remember to do it this time :)
(WebCore::WebGLRenderingContext::checkTextureCompleteness): Need to check for the half-float
extension as well, and update the log message.
* html/canvas/WebGLRenderingContext.h: New extension object.

* html/canvas/WebGLTexture.cpp:
(WebCore::WebGLTexture::WebGLTexture):
(WebCore::WebGLTexture::needToUseBlackTexture): Check for half-float type.
(WebCore::WebGLTexture::update): Mark a texture as half-float if necessary.
* html/canvas/WebGLTexture.h:

* platform/graphics/Extensions3D.h: Add a comment about the new extension.
* platform/graphics/opengl/Extensions3DOpenGL.cpp:
(WebCore::Extensions3DOpenGL::supportsExtension): This extension is available
when GL_ARB_texture_float is supported, so add the name to the translation.

LayoutTests:

Exercise the OES_texture_half_float_linear extension. The new test
is copied from the official Khronos WebGL repository.

* fast/canvas/webgl/oes-texture-float-linear-expected.txt: Change the console log
messages, which now also mention half float linear.
* fast/canvas/webgl/oes-texture-half-float-linear-expected.txt: Added.
* fast/canvas/webgl/oes-texture-half-float-linear.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161688 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: support negative numbers in secondsToString and bytesToString.

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

Reviewed by Joseph Pecoraro.

* UserInterface/Utilities.js:
(Number.secondsToString): Use Math.abs in the size checks.
(Number.bytesToString): Ditto.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161689 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS] Remove unused variable from TileGrid::dropTilesBetweenRects()

Fixes the following build error:

    WebCore/platform/ios/TileGrid.mm:88:23: error: unused variable 'end' [-Werror,-Wunused-variable]
        TileMap::iterator end = m_tiles.end();
                          ^

* platform/ios/TileGrid.mm:
(WebCore::TileGrid::dropTilesBetweenRects): Remove unused
variable now that the for loop uses an auto iterator.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161690 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Remove unimplemented or static ScriptDebugServer features
https://bugs.webkit.org/show_bug.cgi?id=126784

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

Source/JavaScriptCore:

* inspector/protocol/Debugger.json:

Source/WebCore:

These features are unimplemented in the backend, and unused by the
current frontend. Most deal with features that were supported by v8
and are as yet unimplemented by JSC. If we decide to add such features
we can reimplement without conforming to an old implementation.

* bindings/js/ScriptDebugServer.cpp:
* bindings/js/ScriptDebugServer.h:
* bindings/js/ScriptProfiler.h:
* inspector/InspectorDebuggerAgent.cpp:
(WebCore::InspectorDebuggerAgent::disable):
* inspector/InspectorDebuggerAgent.h:
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::reload):
(WebCore::InspectorPageAgent::frameNavigated):
* inspector/InspectorPageAgent.h:
* inspector/InspectorProfilerAgent.cpp:
* inspector/InspectorProfilerAgent.h:
* inspector/PageDebuggerAgent.cpp:
(WebCore::PageDebuggerAgent::didClearMainFrameWindowObject):
* inspector/protocol/Page.json:
* inspector/protocol/Profiler.json:

Source/WebInspectorUI:

* UserInterface/InspectorJSBackendCommands.js:
* UserInterface/InspectorWebBackendCommands.js:
* UserInterface/Legacy/6.0/InspectorWebBackendCommands.js:
* UserInterface/Legacy/7.0/InspectorWebBackendCommands.js:
* Versions/Inspector-iOS-6.0.json:
* Versions/Inspector-iOS-7.0.json:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS] Build Fix: Properly add $SDKROOT/usr/local/include/ to the search path when building PublicDOMInterfaces.h

* bindings/scripts/CodeGeneratorObjC.pm:
(ReadPublicInterfaces):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161692 268f45cc-cd09-0410-ab3c-d52691b4dbfc
iOS doesn't have <OpenGL/gl.h>; fix iOS build.

* platform/graphics/opengl/TemporaryOpenGLSetting.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161693 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix the iOS build.

* platform/audio/mac/MediaSessionManagerMac.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161694 268f45cc-cd09-0410-ab3c-d52691b4dbfc
CSS word-spacing property does not obey percentages
https://bugs.webkit.org/show_bug.cgi?id=126674

Reviewed by Simon Fraser.

Source/WebCore:

One change between CSS2.1 and CSS3 is that the word-spacing CSS property can
take percentages (of the width of the space character) in CSS3. In order to
implement this, the datatype must be changed from a float to a Length, which
can hold percentage values. Then, during layout, we can query the width of
the space character and update the Font's word-spacing value appropriately.
However, the RenderStyle still holds on to the Length (as a rare inherited
value).

Tests: fast/css3-text/css3-word-spacing-percentage/word-spacing-change-font.html
       fast/css3-text/css3-word-spacing-percentage/word-spacing-percentage-parse.html
       fast/css3-text/css3-word-spacing-percentage/word-spacing-percentage.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue): Use Font's computed value instead
of style's Length value.
* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue): word-spacing and letter-spacing no longer are
parsed the same way.
* css/DeprecatedStyleBuilder.cpp:
(WebCore::ApplyPropertyWordSpacing::applyValue): Construct a length from a given
CSSValue and set the style's word spacing with it.
(WebCore::ApplyPropertyWordSpacing::createHandler):
(WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder): Use ApplyPropertyWordSpacing.
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* rendering/RenderBlockLineLayout.cpp:
(WebCore::setLogicalWidthForTextRun): Use Font's computed value instead
of style's Length value.
* rendering/RenderText.cpp:
(WebCore::RenderText::computePreferredLogicalWidths): Ditto.
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseFor): Opt-out of the SimpleLineLayout
if either the percentage or the length is nonzero.
* rendering/line/BreakingContextInlineHeaders.h:
(WebCore::BreakingContext::handleText): Use Font's computed value instead
of style's Length value.
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::wordSpacing):
(WebCore::RenderStyle::setWordSpacing): Consult the Font's space with to compute
percentage values, but hold on to the original Length.
* rendering/style/RenderStyle.h:
* rendering/style/StyleRareInheritedData.cpp:
* rendering/style/StyleRareInheritedData.h: Hold on to the specified Length

LayoutTests:

See per-file description

* fast/css3-text/css3-word-spacing-percentage/word-spacing-change-font-expected.html: Added.
* fast/css3-text/css3-word-spacing-percentage/word-spacing-change-font.html: Added.
Make sure that if Javascript changes the font after initial layout, that the word-spacing
value gets appropriately updated.
* fast/css3-text/css3-word-spacing-percentage/word-spacing-percentage-expected.html: Added.
* fast/css3-text/css3-word-spacing-percentage/word-spacing-percentage-parse-expected.txt: Added.
* fast/css3-text/css3-word-spacing-percentage/word-spacing-percentage-parse.html: Added.
Make sure that the CSSOM yields the correct percentage values when queried.
* fast/css3-text/css3-word-spacing-percentage/word-spacing-percentage.html: Added.
Try some specific values of percentages (-100%, 0%, and 100%).
* css1/text_properties/word_spacing.html: Updated to not disregard percentages
* css2.1/20110323/c541-word-sp-001-expected.html:
* css2.1/20110323/c541-word-sp-001.htm: Ditto
* platform/mac/css1/text_properties/word_spacing-expected.png:
* platform/mac/css1/text_properties/word_spacing-expected.txt: Ditto

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161696 268f45cc-cd09-0410-ab3c-d52691b4dbfc
CTTE in NavigationScheduler
https://bugs.webkit.org/show_bug.cgi?id=126788

Reviewed by Tim Horton.

* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::frameScheduledNavigationImpl):
(WebCore::InspectorInstrumentation::frameClearedScheduledNavigationImpl):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::frameScheduledNavigation):
(WebCore::InspectorInstrumentation::frameClearedScheduledNavigation):
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::frameScheduledNavigation):
(WebCore::InspectorPageAgent::frameClearedScheduledNavigation):
* inspector/InspectorPageAgent.h:
* loader/NavigationScheduler.cpp:
(WebCore::ScheduledNavigation::shouldStartTimer):
(WebCore::ScheduledNavigation::didStartTimer):
(WebCore::ScheduledNavigation::didStopTimer):
(WebCore::NavigationScheduler::NavigationScheduler):
(WebCore::NavigationScheduler::clear):
(WebCore::NavigationScheduler::shouldScheduleNavigation):
(WebCore::NavigationScheduler::scheduleRedirect):
(WebCore::NavigationScheduler::mustLockBackForwardList):
(WebCore::NavigationScheduler::scheduleLocationChange):
(WebCore::NavigationScheduler::scheduleFormSubmission):
(WebCore::NavigationScheduler::scheduleRefresh):
(WebCore::NavigationScheduler::scheduleHistoryNavigation):
(WebCore::NavigationScheduler::timerFired):
(WebCore::NavigationScheduler::schedule):
(WebCore::NavigationScheduler::startTimer):
(WebCore::NavigationScheduler::cancel):
* loader/NavigationScheduler.h:
* page/Frame.cpp:
(WebCore::Frame::Frame):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161697 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix CharsetData.cpp build for iOS
https://bugs.webkit.org/show_bug.cgi?id=126792

Reviewed by Mark Rowe.

CharsetData.cpp should have an empty CharsetTable list for iOS.
Achieve this with an iOS-specific encodings.txt file.

* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* platform/text/mac/ios-encodings.txt: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161698 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove the BlackBerry port from trunk
https://bugs.webkit.org/show_bug.cgi?id=126715

Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-01-10
Reviewed by Anders Carlsson.

.: 

* CMakeLists.txt:
* Source/cmake/OptionsCommon.cmake:

Source/JavaScriptCore: 

* assembler/ARMAssembler.h:
(JSC::ARMAssembler::cacheFlush):
* assembler/ARMv7Assembler.h:
(JSC::ARMv7Assembler::replaceWithJump):
(JSC::ARMv7Assembler::maxJumpReplacementSize):
(JSC::ARMv7Assembler::cacheFlush):
* assembler/MacroAssemblerARMv7.h:
(JSC::MacroAssemblerARMv7::revertJumpReplacementToBranchPtrWithPatch):
* heap/MachineStackMarker.cpp:
(JSC::getPlatformThreadRegisters):
(JSC::otherThreadStackPointer):
(JSC::freePlatformThreadRegisters):
* jit/ExecutableAllocator.h:

Source/WebCore: 

* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::readPixels):
* platform/graphics/ImageBuffer.cpp:
* platform/graphics/ImageBufferData.h:
* platform/graphics/IntPoint.h:
* platform/graphics/IntRect.h:
* platform/graphics/IntSize.h:
* platform/graphics/MediaPlayer.cpp:
* platform/graphics/NativeImagePtr.h:
* platform/graphics/OpenGLESShims.h:
* platform/graphics/Path.cpp:
(WebCore::Path::addPathForRoundedRect):
* platform/graphics/Path.h:
* platform/graphics/PlatformLayer.h:
* platform/graphics/filters/CustomFilterValidatedProgram.cpp:
* platform/graphics/filters/CustomFilterValidatedProgram.h:
* platform/graphics/filters/FilterOperation.h:
* platform/graphics/gpu/DrawingBuffer.cpp:
* platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
* platform/graphics/opengl/Extensions3DOpenGLES.cpp:
(WebCore::Extensions3DOpenGLES::getGraphicsResetStatusARB):
* platform/graphics/opengl/Extensions3DOpenGLES.h:
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):
(WebCore::GraphicsContext3D::prepareTexture):
(WebCore::GraphicsContext3D::bindFramebuffer):
(WebCore::GraphicsContext3D::compileShader):
(WebCore::GraphicsContext3D::copyTexImage2D):
(WebCore::GraphicsContext3D::copyTexSubImage2D):
* platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
(WebCore::GraphicsContext3D::readPixels):
(WebCore::GraphicsContext3D::readPixelsAndConvertToBGRAIfNecessary):
(WebCore::GraphicsContext3D::reshapeFBOs):
* platform/network/NetworkStateNotifier.h:
* platform/network/ResourceHandle.h:
* platform/network/ResourceHandleInternal.h:
* platform/network/ResourceRequestBase.cpp:

Tools: 

* DumpRenderTree/DumpRenderTree.h:
* DumpRenderTree/PixelDumpSupport.cpp:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161699 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed EFL build fix after r161678.

static_cast a size_t to unsigned long for %lu format string.

* page/Console.cpp:
(WebCore::internalAddMessage):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161700 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix iOS build.

* platform/graphics/ImageSource.h:
(WebCore::ImageSource::acceleratedImageDecodingEnabled):
(WebCore::ImageSource::setAcceleratedImageDecodingEnabled):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161701 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[JSC] Revise typed array implementations to match ECMAScript and WebGL Specification
https://bugs.webkit.org/show_bug.cgi?id=126754

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

The ECMAScript specification forbids calling the typed array
constructors without using "new". Change the call data to return
none so we throw and exception in these cases.

* runtime/JSGenericTypedArrayViewConstructorInlines.h:
(JSC::JSGenericTypedArrayViewConstructor<ViewClass>::getCallData):

LayoutTests:

New test which checks that we throw an exception when calling
any of the typed array constructors without using "new".

* js/script-tests/typedarray-constructors.js: Added.
* js/typedarray-constructors-expected.txt: Added.
* js/typedarray-constructors.html: Added.

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