Web Inspector: clicking on a color swatch in the Computed styles tab shouldn't show the color editing popover
https://bugs.webkit.org/show_bug.cgi?id=129093

Reviewed by Timothy Hatcher.

If the current editor is read-only, only allow cycling between color types since it wouldn't make sense to edit
such colors.

* UserInterface/CSSStyleDeclarationTextEditor.js:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164429 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add StackStats sources to cmake and autotools build files
https://bugs.webkit.org/show_bug.cgi?id=129103

Reviewed by Anders Carlsson.

* GNUmakefile.list.am:
* wtf/CMakeLists.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164430 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: content using a CSS transition within a popover causes the popover to disappear
https://bugs.webkit.org/show_bug.cgi?id=129089

Reviewed by Timothy Hatcher.

Simply check that the element being transitioned is indeed the popover's container before assuming
that the "transitonend" received was for a fade-out transition.

* UserInterface/Popover.js:
(WebInspector.Popover.prototype.handleEvent):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164431 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Popover should animate its frame to display its refreshed content
https://bugs.webkit.org/show_bug.cgi?id=129088

Reviewed by Timothy Hatcher.

When calling .update(), we now check whether we can animate the change of frame provided the
new computed frame to best fit the current content still matches the edge the popover uses
to attach to the target frame. If we find that we can do so, we animate the background frame
of the popover while ensuring the anchor point remains stable during the animation such that
only the popover's frame seems to animate.

* UserInterface/Geometry.js:
(WebInspector.Rect.prototype.round):
Returns a new Rect with rounded values, using a floor for the position and a ceil for the size.

* UserInterface/Main.html:
Link to the new UnitBezier.js source file.

* UserInterface/Popover.js:
(WebInspector.Popover):
Make ._anchorPoint an ivar such that we don't need to pass a reference to the anchorPoint into
the various calls leading to an update of the popover's background drawing.

(WebInspector.Popover.prototype.set frame):
We no longer round the values of the frame here, instead calling the new .round() method on Rect
in places where we compute a new frame.

(WebInspector.Popover.prototype.set content):
(WebInspector.Popover.prototype.update):
Update the calls to ._update() to set the new shouldAnimate flag to true in situations where the
popover is already visible.

(WebInspector.Popover.prototype._update):
In the situation where there is a preference to animate the frame, as set by the new shouldAnimate
parameter, check that we can indeed animate by ensuring that the edge the popover uses to attach to
the target frame remains the same upon computing the new best metrics for the new content size. If
we can indeed animate, call _animateFrame(), otherwise set the new frame, anchor point and frame
drawing discretely like we used to.

(WebInspector.Popover.prototype._setAnchorPoint):
New method to ensure we floor the position of the anchor point to ensure, when animating, that the
anchor point remains stationary.

(WebInspector.Popover.prototype._animateFrame):
Using the new UnitBezier class, animate the popover frame from its previous value to its newly computed
value while ensuring the anchor point remains, at all times, the same absolute position such that it
remains stationary during the animation. The spline used to animate the frame is the same that a CSS
transition set with an "ease" timing-function (default value) would use.

(WebInspector.Popover.prototype._drawBackground):
(WebInspector.Popover.prototype._drawFrame):
Adopt new ._edge and ._anchorPoint ivars.

* UserInterface/UnitBezier.js: Added.
New class used to perform animations using a timing function specified with a cubic Bézier curve. The code
is directly adapted from the Source/WebCore/platform/graphics/UnitBezier.h file.

(WebInspector.UnitBezier):
(WebInspector.UnitBezier.prototype.solve):
(WebInspector.UnitBezier.prototype._sampleCurveX):
(WebInspector.UnitBezier.prototype._sampleCurveY):
(WebInspector.UnitBezier.prototype._sampleCurveDerivativeX):
(WebInspector.UnitBezier.prototype._solveCurveX):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164432 268f45cc-cd09-0410-ab3c-d52691b4dbfc
ASSERTION FAILED: isUInt16() on ARMv7 after r113253.
https://bugs.webkit.org/show_bug.cgi?id=129101

Reviewed by Michael Saboff.

If the immediate value type is encoded then we shouldn't reach this assert.
Check the immediate type to avoid assertion in alignemnt check.

* assembler/ARMv7Assembler.h:
(JSC::ARMv7Assembler::add):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164433 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[ASan] WebKit1 sources are not compiled using ASAN macros
<http://webkit.org/b/128871>

Reviewed by Brent Fulgham.

* Configurations/WebKit.xcconfig: Use $inherited for
OTHER_CFLAGS and OTHER_CPLUSPLUSFLAGS so that ASAN_OTHER_CFLAGS
and ASAN_OTHER_CPLUSPLUSFLAGS are inherited from
DebugRelease.xcconfig.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164434 268f45cc-cd09-0410-ab3c-d52691b4dbfc
ASSERT in FrameLoader::shouldInterruptLoadForXFrameOptions
https://bugs.webkit.org/show_bug.cgi?id=129081
<rdar://problem/16026440>

Reviewed by Alexey Proskuryakov.

Do not assert if the server sends us a malformed X-Frame-Options header.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::shouldInterruptLoadForXFrameOptions):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164435 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: create a CodeMirrorEditingController superclass
https://bugs.webkit.org/show_bug.cgi?id=129094

Reviewed by Timothy Hatcher.

Take code that is generic to editing of any text marker out of CodeMirrorColorEditingController to
create a new CodeMirrorEditingController superclass that'll be fit to use for future editing controllers.
Additioanlly, we fix existing issues with such editing by supporting text markers spread across several
lines and more robustly handling the Esc. key being pressed to dismiss a controller's popover.

* UserInterface/CSSStyleDeclarationTextEditor.js:
(WebInspector.CSSStyleDeclarationTextEditor.prototype._createColorSwatches):
Adopt the new .createColorMarkers() method signature to provide a TextRange parameter rather than a single
line number.

* UserInterface/CodeMirrorAdditions.js:
Remove the .boundsForRange() method in favor of a .rectsForRange() method which will allow us to draw better
menus when hovering over a text range by providing tight bounds rather than a large box. We also handle any
line wrapping produced by CodeMirror and remove any leading white-space so that the rects are tight to the
actual characters in the text marker.

We also change .createColorMarkers() to take in a TextRange parameter rather than a line number in order to
better deal with text markers spread across multiple lines.

* UserInterface/CodeMirrorColorEditingController.js:
Remove any code that is adequate for any editing controller (which is moving to CodeMirrorEditingController).
We also adopt new interfaces exposed by CodeMirrorEditingController.

(WebInspector.CodeMirrorColorEditingController):
(WebInspector.CodeMirrorColorEditingController.prototype.get initialValue):
(WebInspector.CodeMirrorColorEditingController.prototype.get cssClassName):
(WebInspector.CodeMirrorColorEditingController.prototype.popoverWillPresent):
(WebInspector.CodeMirrorColorEditingController.prototype.popoverDidPresent):
(WebInspector.CodeMirrorColorEditingController.prototype._colorPickerColorChanged):

* UserInterface/CodeMirrorEditingController.js: Copied from Source/WebInspectorUI/UserInterface/CodeMirrorColorEditingController.js.
New class meant to be subclassed by any future editing controller, and already subclassed by
CodeMirrorColorEditingController. This class exposes several hooks for subclasses to customize its behavior:

.initialValue: a value we can revert to if the editing is canceled
.cssClassName: a CSS class name that can be added to the editing controller's container
.popoverPreferredEdges: a list of preferredEdges as passed to Popover.prototype.present() with a sensible default
.popoverTargetFrameWithRects: a targetFrame passed to Popover.prototype.present(), defaults to a union of provided rects
.popoverWillPresent: called as the popover is about to be presented, typically overridden to set the popover's content
.popoverDidPresent: called as the popover just was presented, typically overridden when content needs to tuned only after
being added to the DOM and setting of the necessary machinery to update the serialized value in the editor based on interaction
within the popover without changing the serialized value upon showing the popover the very first time.

Additionally, the .value property must be an object supporting .toString() and .copy() method.

Finally, the .editingControllerDidStartEditing() and .editingControllerDidFinishEditing() delegate methods are fired
as editing begins and finishes.

(WebInspector.CodeMirrorEditingController):
(WebInspector.CodeMirrorEditingController.prototype.get marker):
(WebInspector.CodeMirrorEditingController.prototype.get range):
(WebInspector.CodeMirrorEditingController.prototype.get value):
(WebInspector.CodeMirrorEditingController.prototype.set value):
(WebInspector.CodeMirrorEditingController.prototype.get delegate):
(WebInspector.CodeMirrorEditingController.prototype.set delegate):
(WebInspector.CodeMirrorEditingController.prototype.get text):
(WebInspector.CodeMirrorEditingController.prototype.set text):
(WebInspector.CodeMirrorEditingController.prototype.get initialValue):
(WebInspector.CodeMirrorEditingController.prototype.get cssClassName):
(WebInspector.CodeMirrorEditingController.prototype.get popover):
(WebInspector.CodeMirrorEditingController.prototype.get popoverPreferredEdges):
(WebInspector.CodeMirrorEditingController.prototype.popoverTargetFrameWithRects):
(WebInspector.CodeMirrorEditingController.prototype.presentHoverMenu):
(WebInspector.CodeMirrorEditingController.prototype.dismissHoverMenu):
(WebInspector.CodeMirrorEditingController.prototype.popoverWillPresent):
(WebInspector.CodeMirrorEditingController.prototype.popoverDidPresent):

(WebInspector.CodeMirrorEditingController.prototype.handleKeydownEvent):
Event handler for keydown events as registered via the new WebInspector.addWindowKeydownListener() method.

(WebInspector.CodeMirrorEditingController.prototype.hoverMenuButtonWasPressed):
(WebInspector.CodeMirrorEditingController.prototype.didDismissPopover):

* UserInterface/Geometry.js:
(WebInspector.Rect.unionOfRects):
(WebInspector.Rect.prototype.unionWithRect):
New utilities to get a Rect that is the union of the provided Rect or array of Rects.

(WebInspector.Polygon):
(WebInspector.Polygon.prototype.bounds):
New class used to store a list of points for a polygon and get its bounds, used by the HoverMenu class.

* UserInterface/HoverMenu.css:
(.hover-menu):
(.hover-menu > svg):
(.hover-menu > svg > rect):
(.hover-menu > img):

* UserInterface/HoverMenu.js:
We remove the assumption that a HoverMenu is only used to draw a single rounded rect based on a simple
Rect and instead support presentation based on an array of Rects where we either:

- draw a single rounded rectangle if there is only a single Rect provided
- draw two disconnected open-ended rects if we're provided with two non-overlapping Rects
- draw a polygon surrounding all provided Rects in all other cases

No matter how the HoverMenu is drawn, the drawing is performed in SVG with either <rect> or a <path> elements.

(WebInspector.HoverMenu):
(WebInspector.HoverMenu.prototype.present):
(WebInspector.HoverMenu.prototype.dismiss):
(WebInspector.HoverMenu.prototype.handleEvent):
(WebInspector.HoverMenu.prototype._handleClickEvent):
(WebInspector.HoverMenu.prototype._drawOutline):
(WebInspector.HoverMenu.prototype._addRect):
(WebInspector.HoverMenu.prototype._addPath):
(WebInspector.HoverMenu.prototype._drawSingleLine):
(WebInspector.HoverMenu.prototype._drawTwoNonOverlappingLines):
(WebInspector.HoverMenu.prototype._drawOverlappingLines):

* UserInterface/Main.html:
Link to the new CodeMirrorEditingController class.

* UserInterface/Main.js:
Expose a new mechanism to deal with window-level handling of keydown events in order to allow
a list of handlers to accept or reject dealing with the provided keydown event based on the order
they were registered, in most recent to oldest registered handler. This allows, for instance, for
a more graceful handling of the Esc. key being pressed in the CodeMirrorEditingController and
bypasses the DOM structure allowing for objects managing elements in different DOM hierarchies
to compete with handling of keydown events.

(WebInspector.loaded):
(WebInspector.addWindowKeydownListener):
(WebInspector.removeWindowKeydownListener):
(WebInspector._updateWindowKeydownListener):
(WebInspector._sharedWindowKeydownListener):

* UserInterface/SourceCodeTextEditor.css:
(.hover-menu.color > img):
Update the offset applied to a HoverMenu button based on the change of layout for such buttons which
are now absolutely positioned in code by HoverMenu rather than being laid out using the flex-box model.

* UserInterface/SourceCodeTextEditor.js:
Abstrct away the assumption that only a color editing controller may be used to edit text markers in
a source code text editor.

(WebInspector.SourceCodeTextEditor.prototype.hidden):
Ensure we remove any currently-displayed hover menu for an editing controller when the editor is hidden.
This would happen in the situation where a keyboard shortcut was used to jump to another part of the
Web Inspector UI without using the mouse.

(WebInspector.SourceCodeTextEditor.prototype.contentDidChange):
Since we're now working with text ranges rather than lines, remove the code where we'd work out a set of
changed lines and call ._updateEditableMarkers() with the changed range directly instead.

(WebInspector.SourceCodeTextEditor.prototype._contentDidPopulate):
(WebInspector.SourceCodeTextEditor.prototype.tokenTrackingControllerNewHighlightCandidate):
(WebInspector.SourceCodeTextEditor.prototype.tokenTrackingControllerMouseOutOfHoveredMarker):
Adopt the more generic method names rather than color-specific ones.

(WebInspector.SourceCodeTextEditor.prototype._showPopover):
When showing the popover outside of the use of a CodeMirrorEditingController, such as a JavaScript expression
when debugging, also deal with the possibility of the highlighted range containing multiple lines rather
than assume a single line.

(WebInspector.SourceCodeTextEditor.prototype._updateEditableMarkers):
More generic method name to support future, non-color editing controllers.

(WebInspector.SourceCodeTextEditor.prototype._tokenTrackingControllerHighlightedMarkedExpression):
Find the outermost marker in the list of markers provided such that a marker containing other markers
shows the UI for the containing marker. For instance, a gradient marker would contain several color
markers and it's preferable to show the editing UI for the whole gradient rather than a specific color.

Additionally, adopt more generic ivars and method names to support future, non-color editing controllers.

(WebInspector.SourceCodeTextEditor.prototype._dismissEditingController):
Support for new parameter instructing that the editing controller dismissal should be instant rather than
animated, which is the default. This is useful when, for instance, the text editor is cleared.

(WebInspector.SourceCodeTextEditor.prototype.editingControllerDidStartEditing):
(WebInspector.SourceCodeTextEditor.prototype.editingControllerDidFinishEditing):
Adopt the more generic method names rather than color-specific ones.

* UserInterface/TextEditor.js:
(WebInspector.TextEditor.prototype.rectsForRange):
Remove .boundsForRange() in favor of this new method where we return a series of rects so that we may
draw a more pleasing HoverMenu.

(WebInspector.TextEditor.prototype.createColorMarkers):
Use a TextRanger rather than a single line number to match the underlying CodeMirror extension method.

(WebInspector.TextEditor.prototype.editingControllerForMarker):
Use the provided TextMarker's type to provide the most adequate CodeMirrorEditingController class.

* UserInterface/TextMarker.js:
(WebInspector.TextMarker.prototype.get rects):
Remove the .bounds property in favor of .rects to match the underlying CodeMirror extension method.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164436 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unskip fast/workers/use-machine-stack.html

Unreviewed test gardening. This was fixed as part of http://trac.webkit.org/changeset/164371, 
so we're unskipping it.

* TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164437 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebKitGTK+ should stop using COMPILE_ASSERT_MATCHING_ENUM macros
https://bugs.webkit.org/show_bug.cgi?id=127800

Patch by Enrique Ocaña González <eocanha@igalia.com> on 2014-02-20
Reviewed by Martin Robinson.

Source/WebKit:

* PlatformGTK.cmake: Removed AssertMatchingEnums.cpp

Source/WebKit/gtk:

* GNUmakefile.am: Removed AssertMatchingEnums.cpp
* WebCoreSupport/AssertMatchingEnums.cpp: Removed.
* WebCoreSupport/DumpRenderTreeSupportGtk.cpp: Defined and applied type conversions.
(toWebCoreFindOptions):
(DumpRenderTreeSupportGtk::findString):
* WebCoreSupport/FrameLoaderClientGtk.cpp: Defined and applied type conversions.
(WebKit::toWebKitNetworkError):
(WebKit::FrameLoaderClient::dispatchDidFailLoading):
(WebKit::FrameLoaderClient::dispatchDidFailLoad):
(WebKit::FrameLoaderClient::shouldFallBack):
* webkit/webkitwebnavigationaction.cpp: Defined and applied type conversions.
(WebKit::kit):
(WebKit::core):
* webkit/webkitwebsettings.cpp: Defined and applied type conversions.
(WebKit::core):
* webkit/webkitwebview.cpp: Defined and applied type conversions.
(copyGtkTargetListConvertingWebCoreEnumValuesToWebKitEnumValues):
(webkit_web_view_dispose):
(webkit_web_view_init):
(webkit_web_view_get_copy_target_list):
(webkit_web_view_get_paste_target_list):
* webkit/webkitwebviewprivate.h: Added targetList private field, which mirrors PasteboardHelper::defaultPasteboardHelper()->targetList() but with the flags converted to WebKitWebViewTargetInfo

Source/WebKit2:

* UIProcess/API/gtk/WebKitAuthenticationRequest.cpp: Defined and applied type conversions.
(webkit_authentication_request_get_scheme):
* UIProcess/API/gtk/WebKitCookieManager.cpp: Defined and applied type conversions.
(toWebKitCookieAcceptPolicy):
(toHTTPCookieAcceptPolicy):
(webkit_cookie_manager_set_persistent_storage):
(webkit_cookie_manager_set_accept_policy):
(webkitCookieManagerGetAcceptPolicyCallback):
* UIProcess/API/gtk/WebKitCredential.cpp: Defined and applied type conversions.
(toWebKitCredentialPersistence):
(toWebCoreCredentialPersistence):
(webkit_credential_new):
(webkit_credential_get_persistence):
* UIProcess/API/gtk/WebKitDownload.cpp: Defined and applied type conversions.
(webkitDownloadFailed):
* UIProcess/API/gtk/WebKitError.cpp: Defined and applied type conversions.
* UIProcess/API/gtk/WebKitFindController.cpp: Defined and applied type conversions.
(toWebKitFindOptions):
(webKitFindControllerPerform):
(webkit_find_controller_search_next):
(webkit_find_controller_search_previous):
* UIProcess/API/gtk/WebKitFindController.h: Added new private fields to the enum, needed to match conversions.
* UIProcess/API/gtk/WebKitInjectedBundleClient.cpp: Defined and applied type conversions.
(didReceiveWebViewMessageFromInjectedBundle):
* UIProcess/API/gtk/WebKitLoaderClient.cpp: Defined and applied type conversions.
(didFailProvisionalLoadWithErrorForFrame):
(didFailLoadWithErrorForFrame):
* UIProcess/API/gtk/WebKitNavigationPolicyDecision.cpp: Defined and applied type conversions.
* UIProcess/API/gtk/WebKitPolicyClient.cpp: Defined and applied type conversions.
(toWebKitNavigationType):
(decidePolicyForNavigationAction):
(decidePolicyForNewWindowAction):
* UIProcess/API/gtk/WebKitPrintOperation.cpp: Defined and applied type conversions.
(drawPagesForPrintingCompleted):
* UIProcess/API/gtk/WebKitPrivate.cpp: Defined and applied type conversions.
(toWebKitError):
(toWebCoreError):
* UIProcess/API/gtk/WebKitPrivate.h: Defined and applied type conversions.
* UIProcess/API/gtk/WebKitURISchemeRequest.cpp: Defined and applied type conversions.
(webkit_uri_scheme_request_finish_error):
* UIProcess/API/gtk/WebKitWebContext.cpp: Defined and applied type conversions.
(toWebKitProcessModel):
(webkit_web_context_set_process_model):
(webkit_web_context_get_process_model):
* UIProcess/API/gtk/WebKitWebView.cpp: Defined and applied type conversions.
(toSnapshotRegion):
(webkit_web_view_get_snapshot):
* UIProcess/API/gtk/WebKitWebViewGroup.cpp: Defined and applied type conversions.
(toWebCoreUserContentInjectedFrames):
(webkit_web_view_group_add_user_style_sheet):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164438 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Dynamically generated JSExport protocols added to a class results in a crash
https://bugs.webkit.org/show_bug.cgi?id=129108

Reviewed by Oliver Hunt.

We're not getting any information from the runtime about the types of the methods on
these protocols because they didn't exist at compile time. We should handle this gracefully.

* API/ObjCCallbackFunction.mm:
(objCCallbackFunctionForInvocation):
* API/tests/JSExportTests.mm:
(+[JSExportTests exportDynamicallyGeneratedProtocolTest]):
(runJSExportTests):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164439 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rename RenderBlockFlow::clearFloats and RenderBlockFlow::newLine to be more accurate
https://bugs.webkit.org/show_bug.cgi?id=128991

Reviewed by David Hyatt.

Rename clearFloats to rebuildFloatingObjectSetFromIntrudingFloats
since it does just that.

Rename newLine to clearFloats because it actually does what the CSS
spec calls clearing floats. This also matches clearFloatsIfNeeded.

This also removes a FIXME comment that points to a bug that has
already been fixed.

This patch is based on a Blink patch by leviw:
https://src.chromium.org/viewvc/blink?revision=158598&view=revision

No new tests, no behavior change.

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats):
(WebCore::RenderBlockFlow::layoutBlock):
(WebCore::RenderBlockFlow::clearFloats):
* rendering/RenderBlockFlow.h:
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::layoutRunsAndFloats):
(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
* rendering/line/BreakingContextInlineHeaders.h:
(WebCore::BreakingContext::handleFloat):
* rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::layout):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164440 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rename border/padding/margin width/height to horizontal/vertical extent on RenderBoxModelObject
https://bugs.webkit.org/show_bug.cgi?id=129043

Reviewed by David Hyatt.

Using horizontal extent instead of width and vertical extent instead
of height makes it more obvious that these are measurements of both
border/margin/padding sides, not just one.

As David Hyatt put it: "I dislike using terms like 'width' since it
could be confused with the actual border-width CSS name, i.e., a
person new to this code would think the method was returning the pixel
width of a single border."

No new tests, no behavior change.

* html/HTMLAppletElement.cpp:
(WebCore::HTMLAppletElement::updateWidget):
* inspector/InspectorOverlay.cpp:
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::checkFloatsInCleanLine):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::repaintLayerRectsForImage):
(WebCore::RenderBox::positionForPoint):
* rendering/RenderBoxModelObject.h:
(WebCore::RenderBoxModelObject::horizontalBorderExtent):
(WebCore::RenderBoxModelObject::verticalBorderExtent):
(WebCore::RenderBoxModelObject::verticalBorderAndPaddingExtent):
(WebCore::RenderBoxModelObject::horizontalBorderAndPaddingExtent):
(WebCore::RenderBoxModelObject::verticalMarginExtent):
(WebCore::RenderBoxModelObject::horizontalMarginExtent):
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
(WebCore::RenderDeprecatedFlexibleBox::layoutVerticalBox):
(WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
* rendering/RenderFieldset.cpp:
(WebCore::RenderFieldset::computePreferredLogicalWidths):
* rendering/RenderFileUploadControl.cpp:
(WebCore::RenderFileUploadControl::computePreferredLogicalWidths):
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::crossAxisMarginExtentForChild):
(WebCore::RenderFlexibleBox::mainAxisBorderAndPaddingExtentForChild):
(WebCore::RenderFlexibleBox::computeNextFlexLine):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::localCaretRect):
(WebCore::RenderInline::generateCulledLineBoxRects):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::resize):
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::computePreferredLogicalWidths):
(WebCore::RenderListBox::computeLogicalHeight):
* rendering/RenderMenuList.cpp:
(RenderMenuList::computePreferredLogicalWidths):
* rendering/RenderScrollbar.cpp:
(WebCore::RenderScrollbar::trackPieceRectWithMargins):
* rendering/RenderSlider.cpp:
(WebCore::RenderSlider::computePreferredLogicalWidths):
* rendering/RenderTextControl.cpp:
(WebCore::RenderTextControl::computeLogicalHeight):
* rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::layout):
* rendering/line/LineLayoutState.h:
(WebCore::FloatWithRect::FloatWithRect):
* rendering/shapes/ShapeInfo.cpp:
(WebCore::ShapeInfo<RenderType>::setReferenceBoxLogicalSize):
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::updateCachedBoundaries):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164441 268f45cc-cd09-0410-ab3c-d52691b4dbfc
FTL should not emit stack overflow checks in leaf functions
https://bugs.webkit.org/show_bug.cgi?id=129085

Reviewed by Michael Saboff.
        
Miniscule (0.5%) speed-up on V8v7.

* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::lower):
(JSC::FTL::LowerDFGToLLVM::didOverflowStack):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164442 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Replace uses of deprecated POSIX index() with strchr() in ObjcRuntimeExtras.h
https://bugs.webkit.org/show_bug.cgi?id=128610

Reviewed by Anders Carlsson.

index() is deprecated in favor of strchr() so we should use the latter.

* API/JSWrapperMap.mm:
(selectorToPropertyName):
* API/ObjcRuntimeExtras.h:
(parseObjCType):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164443 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Automake] Collect the JavaScript files required for JSC builtins through a wildcard
https://bugs.webkit.org/show_bug.cgi?id=129115

Reviewed by Oliver Hunt.

* GNUmakefile.list.am: Simplify adding new JavaScriptCore builtins by using a wildcard
to gather all the JavaScript files instead of listing each file explicitly.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164444 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION (r164417): ASSERTION FAILED: isBranch() in X86 32 bit build
https://bugs.webkit.org/show_bug.cgi?id=129118

Reviewed by Filip Pizlo.

Changed 32 bit version of SpeculativeJIT::compile handling of Jump nodes to match
what is in the 64 bit build.

* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164445 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: rich editing of CSS gradients
https://bugs.webkit.org/show_bug.cgi?id=119686

Reviewed by Timothy Hatcher.

Look for gradient definitions in CSS resources and implement a gradient-specific CodeMirrorEditingController
to edit those CSS gradients. The CodeMirrorGradientEditingController consists of a GradientSlider, a new widget
allowing the editing of gradient stops, a <select> to pick between various gradient types, a text input to edit
the gradient angle (for linear gradients) and finally a ColorPicker when a gradient stop is picked for editing.

* Localizations/en.lproj/localizedStrings.js:
New localized strings for the content of the gradient editing controller popover.

* UserInterface/CodeMirrorAdditions.js:
New .createGradientMarkers() method which, similar to .createColorMarkers(), takes in an optional TextRange, and
looks for all gradients specified in CSS to create TextMarkers with new type WebInspector.TextMarker.Type.Gradient.
In order to fully identify these CSS gradient strings, we implement a tokenizer to look for the final closing
parenthesis since there can be nested opening and closing parentheses as colors are specified for stops.

* UserInterface/CodeMirrorGradientEditingController.css: Added.
(.gradient-editing-controller):
(.gradient-editing-controller.edits-color):
(.gradient-editing-controller.radial-gradient):
(.gradient-editing-controller.edits-color.radial-gradient):
(.gradient-editing-controller select):
(.gradient-editing-controller .gradient-slider):
(.gradient-editing-controller .color-picker):
(.gradient-editing-controller > .color-picker > .slider):
(.gradient-editing-controller > .color-picker > .brightness):
(.gradient-editing-controller > .color-picker > .opacity):
(.gradient-editing-controller > label):
(.gradient-editing-controller.radial-gradient > label):
(.gradient-editing-controller.edits-color > label):
(.gradient-editing-controller > label > input):

* UserInterface/CodeMirrorGradientEditingController.js: Added.
(WebInspector.CodeMirrorGradientEditingController):
(WebInspector.CodeMirrorGradientEditingController.prototype.get initialValue):
(WebInspector.CodeMirrorGradientEditingController.prototype.get cssClassName):
(WebInspector.CodeMirrorGradientEditingController.prototype.get popoverPreferredEdges):
(WebInspector.CodeMirrorGradientEditingController.prototype.popoverTargetFrameWithRects):
(WebInspector.CodeMirrorGradientEditingController.prototype.popoverWillPresent):
(WebInspector.CodeMirrorGradientEditingController.prototype.popoverDidPresent):
Implementation of CodeMirrorEditingController methods meant to be overridden. This allows us
to customize the popover's appearance, mostly to control how it attaches to the gradient
strings in the editor.

(WebInspector.CodeMirrorGradientEditingController.prototype.handleEvent):
Event handler for changes in the <select> governing gradient type and <input> for the angle.

(WebInspector.CodeMirrorGradientEditingController.prototype.gradientSliderStopsDidChange):
Implementation of a GradientSlider delegation method, we use this to update the .text property
in order to propagate the stops change to the editor.

(WebInspector.CodeMirrorGradientEditingController.prototype.gradientSliderStopWasSelected):
Implementation of a GradientSlider delegation method, we use this to control the display of the
ColorPicker used to edit the color of a selected stop.

(WebInspector.CodeMirrorGradientEditingController.prototype._handleInputEvent):
Deal with changes in the <input> for the angle, ensuring we have a "º" string added to the value.

(WebInspector.CodeMirrorGradientEditingController.prototype._handleChangeEvent):
Deal with changes in the <select> for the type, preserving the stops list from one gradient type
to the other. Gradient type-specific information (angle for linear gradients, sizing for radial
gradients) is lost as we toggle between gradient types.

(WebInspector.CodeMirrorGradientEditingController.prototype._colorPickerColorChanged):
Propagate a color change in the ColorPicker to the stop being edited in the GradientSlider and
and update the .text property in order to propagate the stops change to the editor.

(WebInspector.CodeMirrorGradientEditingController.prototype._updateCSSClassForGradientType):
As we toggle the gradient type in ._handleChangeEvent(), update the CSS class used to hide or show
the angle <input> which is only relevant for linear gradients.

* UserInterface/ColorPicker.js:
(WebInspector.ColorPicker):
Adopt the new Checkers.svg file to display the checkers pattern in the background of the opacity slider.

(WebInspector.ColorPicker.prototype.get colorWheel):
Expose the ColorWheel such that it can be sized by ColorPicker clients.

(WebInspector.ColorPicker.prototype._updateColor):
Drive-by fix for a bug where we'd attempt to use the RGB components of a color to get the alpha-aware version
of the color even though the base format was HSL.

* UserInterface/Gradient.js: Added.
Parser for gradient strings as passed from the CodeMirror .createGradientMarkers() extension method. In the case
of linear gradients, we parse all values, save for lengths, and in the case of radial gradients, we preserve the
sizing information as a string and parse only the gradient stops as the sizing information is only useful to show
in an editor if attached to an element with metrics.

Since instances of Gradient are used as the .value property of CodeMirrorGradientEditingController, we implement
the required .copy() and .toString() methods. The .toString() implementations are aware of default values for angles
and color stop offsets and only print those as necessary and use shorthands when possible.

(WebInspector.Gradient.fromString):
(WebInspector.Gradient.stopsWithComponents):
(WebInspector.Gradient.stringFromStops):
(WebInspector.LinearGradient):
(WebInspector.LinearGradient.linearGradientWithComponents):
(WebInspector.LinearGradient.prototype.copy):
(WebInspector.LinearGradient.prototype.toString):
(WebInspector.RadialGradient):
(WebInspector.RadialGradient.radialGradientWithComponents):
(WebInspector.RadialGradient.prototype.copy):
(WebInspector.RadialGradient.prototype.toString):

* UserInterface/GradientSlider.css: Added.
(.gradient-slider):
(.gradient-slider > canvas):
(.gradient-slider > .add-area):
(.gradient-slider-knob):
(.gradient-slider-knob.shadow):
(.gradient-slider-knob.selected):
(.gradient-slider-knob.detaching):
(.gradient-slider-knob.fade-out):
(.gradient-slider-knob > div):
(.gradient-slider-knob > img):

* UserInterface/GradientSlider.js: Added.
Widget used to edit a list of stops for a gradient, linear or radial. The widget features a <canvas> element
that draws the gradient as a linear gradient from left to right with checkers in the background to correctly
display transparent colors. Attached to this background, individual knobs are shown for each stop in the provided
stops array. These knobs can be dragged from left to right to change the matching stop offset, but also down to
detach the knob and remove this stop. Additionally, knobs can be clicked to toggle their selected state, where only
one knob can be selected at a time. The Esc. key is used to remove selection of the currently selected knob.

(WebInspector.GradientSlider):
(WebInspector.GradientSlider.prototype.get element):
(WebInspector.GradientSlider.prototype.get stops):
(WebInspector.GradientSlider.prototype.set stops):
(WebInspector.GradientSlider.prototype.get selectedStop):
(WebInspector.GradientSlider.prototype.handleEvent):
(WebInspector.GradientSlider.prototype.handleKeydownEvent):
(WebInspector.GradientSlider.prototype.knobXDidChange):
(WebInspector.GradientSlider.prototype.knobCanDetach):
(WebInspector.GradientSlider.prototype.knobWillDetach):
(WebInspector.GradientSlider.prototype.knobSelectionChanged):
(WebInspector.GradientSlider.prototype._handleMouseover):
(WebInspector.GradientSlider.prototype._handleMousemove):
(WebInspector.GradientSlider.prototype._handleMouseout):
(WebInspector.GradientSlider.prototype._handleClick):
(WebInspector.GradientSlider.prototype._updateShadowKnob):
(WebInspector.GradientSlider.prototype._sortStops):
(WebInspector.GradientSlider.prototype._updateStops):
(WebInspector.GradientSlider.prototype._updateCanvas):
(WebInspector.GradientSlider.prototype._updateKnobs):
(WebInspector.GradientSliderKnob):
(WebInspector.GradientSliderKnob.prototype.get element):
(WebInspector.GradientSliderKnob.prototype.get stop):
(WebInspector.GradientSliderKnob.prototype.set stop):
(WebInspector.GradientSliderKnob.prototype.get x):
(WebInspector.GradientSliderKnob.prototype.set x):
(WebInspector.GradientSliderKnob.prototype.get y):
(WebInspector.GradientSliderKnob.prototype.set y):
(WebInspector.GradientSliderKnob.prototype.get wellColor):
(WebInspector.GradientSliderKnob.prototype.set wellColor):
(WebInspector.GradientSliderKnob.prototype.get selected):
(WebInspector.GradientSliderKnob.prototype.set selected):
(WebInspector.GradientSliderKnob.prototype.handleEvent):
(WebInspector.GradientSliderKnob.prototype._handleMousedown):
(WebInspector.GradientSliderKnob.prototype._handleMousemove):
(WebInspector.GradientSliderKnob.prototype._handleMouseup):
(WebInspector.GradientSliderKnob.prototype._handleTransitionEnd):
(WebInspector.GradientSliderKnob.prototype._updateTransform):

* UserInterface/Images/Checkers.svg: Added.
New asset to draw checkers for color wells.

* UserInterface/Images/GradientStop.png: Added.
* UserInterface/Images/GradientStop@2x.png: Added.
* UserInterface/Images/GradientStopSelected.png: Added.
* UserInterface/Images/GradientStopSelected@2x.png: Added.
New assets used by the gradient slider.

* UserInterface/Main.html:
Link to the new source files.

* UserInterface/SourceCodeTextEditor.js:
(WebInspector.SourceCodeTextEditor.prototype._updateEditableMarkers):
Add a call to .createGradientMarkers() such that we support editing of CSS gradients in such editors.

(WebInspector.SourceCodeTextEditor.prototype._tokenTrackingControllerHighlightedMarkedExpression):
Also recognize gradient markers as valid editable markers.

* UserInterface/TextEditor.js:
(WebInspector.TextEditor.prototype.createGradientMarkers):
Wrapper for the CodeMirror extension method .createGradientMarkers() such that it may be used by subclasses
that have no knowledge of CodeMirror.

(WebInspector.TextEditor.prototype.editingControllerForMarker):
Return a CodeMirrorGradientEditingController for TextMarkers with WebInspector.TextMarker.Type.Gradient type.

* UserInterface/TextMarker.js:
Add the WebInspector.TextMarker.Type.Gradient type.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164446 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add a JSC option to disable EdenCollections
https://bugs.webkit.org/show_bug.cgi?id=128849

Reviewed by Mark Lam.

This will help quickly identify whether or not GenGC is responsible for a
particular crash by prematurely collecting a live object.

* heap/Heap.cpp:
(JSC::Heap::collect):
(JSC::Heap::shouldDoFullCollection):
* heap/Heap.h:
* runtime/Options.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164447 268f45cc-cd09-0410-ab3c-d52691b4dbfc
CopiedBlock::pin can call into fastFree while forbidden
https://bugs.webkit.org/show_bug.cgi?id=128654

Reviewed by Oliver Hunt.

A FullCollection that skips copying doesn't clear the CopyWorkList of the all the surviving
CopiedBlocks because we currently only call didSurviveGC() at the beginning of FullCollections.

EdenCollections always do copying, therefore they always clear all CopyWorkLists.

The fix is to call didSurviveGC() for all surviving CopiedBlocks at the end of FullCollections
as well at the beginning.

* heap/CopiedBlock.h:
(JSC::CopiedBlock::didSurviveGC):
* heap/CopiedSpace.cpp:
(JSC::CopiedSpace::doneCopying):


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