Incorrect use of jsCast in a finalizer
https://bugs.webkit.org/show_bug.cgi?id=117807

Reviewed by Geoffrey Garen.

We can't use jsCast in a finalizer as it checks an object's structure,
and the structure may already have been swept by that point.  Use a
static_cast instead.

* bridge/runtime_array.cpp:
(JSC::RuntimeArray::destroy):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151747 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION: Cannot open Silverlight preferences via context menu
https://bugs.webkit.org/show_bug.cgi?id=117806
<rdar://problem/14166644>

Reviewed by Beth Dakin.

Hook the LSOpenCFURLRef function and make the UI process open the URL if it's the URL for the
Silverlight Preferences application. This is what we do for the Flash updater.

* PluginProcess/PluginProcess.h:
* PluginProcess/mac/PluginProcessMac.mm:
(WebKit::openCFURLRef):
(WebKit::initializeShim):
(WebKit::PluginProcess::openURL):
* PluginProcess/mac/PluginProcessShim.h:
* PluginProcess/mac/PluginProcessShim.mm:
(WebKit::shimLSOpenCFURLRef):
* UIProcess/Plugins/PluginProcessProxy.h:
* UIProcess/Plugins/PluginProcessProxy.messages.in:
* UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
(WebKit::isSilverlightPreferencesURL):
(WebKit::shouldOpenURL):
(WebKit::PluginProcessProxy::openURL):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151748 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix a few missed renames from Exclusions -> Shapes
https://bugs.webkit.org/show_bug.cgi?id=117803

Patch by Bem Jones-Bey <bjonesbe@adobe.com> on 2013-06-19
Reviewed by David Hyatt.

In the great CSS Exclusions to CSS Shapes rename, a few instances were
missed. This fixes those instances.

No new tests, no behavior change, just renames.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::updateRegionsAndShapesBeforeChildLayout):
(WebCore::RenderBlock::updateRegionsAndShapesAfterChildLayout):
(WebCore::RenderBlock::layoutBlock):
(WebCore::RenderBlock::logicalLeftOffsetForLine):
(WebCore::RenderBlock::logicalRightOffsetForLine):
* rendering/RenderBlock.h:
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::layoutBlock):
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::layoutBlock):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::layoutBlock):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151750 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed build fix for Apple Windows port.

* WebCoreSupport/WebFrameNetworkingContext.cpp:
(WebFrameNetworkingContext::ensurePrivateBrowsingSession):


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

* WebCoreSupport/WebFrameNetworkingContext.cpp:
(WebFrameNetworkingContext::ensurePrivateBrowsingSession): Make sure returned generic
type is a CFStringRef before casting.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151752 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Windows] Correct style on last patch.

Reviewed by Tim Horton.

* WebCoreSupport/WebFrameNetworkingContext.cpp:
(WebFrameNetworkingContext::ensurePrivateBrowsingSession):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151753 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make sure to use CSSValueID and CSSPropertyID rather than integers
https://bugs.webkit.org/show_bug.cgi?id=117481

Reviewed by Benjamin Poulain.

This will ensure that types are enforced when passing arguments in various
css functions. Having a compile time check make sure that no mistakes
will be done over the type.

The parser was also patched to directly use CSSValueID over integers.
This patch also fixes various call sites abusing the usage of integers.
This is part 1 of 2.

No new tests : existing ones should cover.

* WebCore.xcodeproj/project.pbxproj: copy CSSValueKeywords.h as it could be used in WebKit/ for example.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::valueForRepeatRule):
(WebCore::cssIdentifierForFontSizeKeyword):
(WebCore::identifierForFamily):
(WebCore::valueForFamily):
* css/CSSGrammar.y.in:
* css/CSSParser.cpp:
(WebCore::parseColorValue):
(WebCore::parseKeywordValue):
(WebCore::CSSParser::parseValidPrimitive):
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseContent):
(WebCore::CSSParser::parseBackgroundColor):
(WebCore::CSSParser::parseFillPositionComponent):
(WebCore::CSSParser::parse3ValuesFillPosition):
(WebCore::CSSParser::parseFillRepeat):
(WebCore::CSSParser::parseAnimationProperty):
(WebCore::CSSParser::parseCounterContent):
(WebCore::CSSParser::parseLineHeight):
(WebCore::CSSParser::parseFontSize):
(WebCore::CSSParser::createFontWeightValueKeyword):
(WebCore::CSSParser::parseFontWeight):
(WebCore::parseDeprecatedGradientColorStop):
(WebCore::parseGradientColorOrKeyword):
(WebCore::CSSParser::parseDeprecatedRadialGradient):
(WebCore::CSSParser::rewriteSpecifiers):
* css/CSSParser.h:
* css/CSSParserValues.h:
* css/CSSPrimitiveValue.h:
* css/CSSValuePool.cpp:
(WebCore::CSSValuePool::createIdentifierValue):
* css/CSSValuePool.h:
* css/StylePropertySet.cpp:
(WebCore::MutableStylePropertySet::setProperty):
* css/StylePropertySet.h:
* dom/StyledElement.cpp:
(WebCore::StyledElement::setInlineStyleProperty):
(WebCore::StyledElement::addPropertyToPresentationAttributeStyle):
* dom/StyledElement.h:
* editing/EditingStyle.cpp:
(WebCore::HTMLFontSizeEquivalent::attributeValueAsCSSValue):
(WebCore::EditingStyle::prepareToApplyAt):
* editing/EditorCommand.cpp:
(WebCore::executeApplyStyle):
(WebCore::executeFontSize):
* html/HTMLElement.cpp:
(WebCore::unicodeBidiAttributeForDirAuto):
(WebCore::HTMLElement::applyAlignmentAttributeToStyle):
* html/HTMLFontElement.cpp:
(WebCore::HTMLFontElement::cssValueFromFontSizeNumber):
(WebCore::HTMLFontElement::collectStyleForPresentationAttribute):
* html/HTMLFontElement.h:
* html/HTMLTableElement.cpp:
(WebCore::leakBorderStyle):
* html/track/TextTrackCue.cpp:
(WebCore::TextTrackCue::getCSSWritingDirection):
(WebCore::TextTrackCue::getCSSWritingMode):
* html/track/TextTrackCue.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151754 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove the SegmentedVector inline segment to shrink CodeBlock by 6X
https://bugs.webkit.org/show_bug.cgi?id=117808

Reviewed by Geoffrey Garen.

SegmentedVector allocation isn't super hot, but we do tend to have many
live SegmentedVectors at runtime, particularly in CodeBlocks, so the
right tradeoff is to allocate segments out-of-line as needed.

This reduces startup memory usage @ google.com by about 6MB.

No regression on SunSpider.

* wtf/SegmentedVector.h:
(WTF::SegmentedVector::SegmentedVector):
(WTF::SegmentedVector::at):
(WTF::SegmentedVector::append):
(WTF::SegmentedVector::removeLast):
(WTF::SegmentedVector::clear):
(WTF::SegmentedVector::deleteAllSegments): No more inline segment.

(WTF::SegmentedVector::ensureSegmentsFor): This code used to assume
that there was always a 0 segment, so the math would underflow if there
were no 0 segment. I udpated the math to account for having no segments.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151755 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fixed reviewer name

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151756 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use the PlatformEvent timestamp when creating a DOM Event
https://bugs.webkit.org/show_bug.cgi?id=117179

Patch by Benjamin Poulain <bpoulain@apple.com> on 2013-06-19
Reviewed by Darin Adler.

Source/WebCore: 

Previously, the platform event's timestamp was ignored by WebCore and each
new event would get a new timestamp by calling WTF::currentTime().

The problem is there can be a significant delay between the input event and
it being dispatched to JavaScript. Computing the velocity/acceleration of the cursor
is impossible since the delay vary from event to events.
On WebKit2, the delay per event typically vary between 0 and 30ms.

This patch changes the Event creation code to use the timer passed by the underlying platform event.

* WebCore.exp.in:
* dom/Event.cpp:
(WebCore::Event::Event):
* dom/Event.h:
* dom/GestureEvent.cpp:
(WebCore::GestureEvent::create):
(WebCore::GestureEvent::GestureEvent):
* dom/GestureEvent.h:
* dom/KeyboardEvent.cpp:
(WebCore::KeyboardEvent::KeyboardEvent):
* dom/KeyboardEvent.h:
* dom/MouseEvent.cpp:
(WebCore::MouseEvent::create):
(WebCore::MouseEvent::MouseEvent):
(WebCore::SimulatedMouseEvent::SimulatedMouseEvent):
* dom/MouseEvent.h:
* dom/MouseRelatedEvent.cpp:
(WebCore::MouseRelatedEvent::MouseRelatedEvent):
* dom/MouseRelatedEvent.h:
* dom/TouchEvent.cpp:
(WebCore::TouchEvent::TouchEvent):
* dom/UIEvent.cpp:
(WebCore::UIEvent::UIEvent):
* dom/UIEvent.h:
* dom/UIEventWithKeyState.h:
(WebCore::UIEventWithKeyState::UIEventWithKeyState):
* dom/WheelEvent.cpp:
(WebCore::WheelEvent::WheelEvent):
(WebCore::WheelEventDispatchMediator::WheelEventDispatchMediator):
* dom/WheelEvent.h:
(WebCore::WheelEvent::create):
* page/EventHandler.cpp:
(WebCore::EventHandler::dispatchDragEvent):
* platform/mac/PlatformEventFactoryMac.mm:
(WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder):
(WebCore::PlatformWheelEventBuilder::PlatformWheelEventBuilder):
(WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
(WebCore::PlatformGestureEventBuilder::PlatformGestureEventBuilder):

Source/WebKit/mac: 

* WebView/WebPDFView.mm:
(-[WebPDFView PDFViewWillClickOnLink:withURL:]):

Source/WebKit2: 

* Shared/mac/WebEventFactory.mm:
(WebKit::WebEventFactory::createWebMouseEvent):
(WebKit::WebEventFactory::createWebWheelEvent):
(WebKit::WebEventFactory::createWebKeyboardEvent):
(WebKit::WebEventFactory::createWebGestureEvent):

Tools: 

* WebKitTestRunner/mac/EventSenderProxy.mm:
(WTR::EventSenderProxy::mouseDown):
(WTR::EventSenderProxy::mouseUp):
(WTR::EventSenderProxy::mouseMoveTo):
(WTR::EventSenderProxy::keyDown):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151757 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rebaseline 24bit-22khz-resample on Mac

The result did not match the expectation after a system update.

Patch by Benjamin Poulain <bpoulain@apple.com> on 2013-06-19

* platform/mac-wk2/webaudio/codec-tests/wav/24bit-22khz-resample-expected.wav:
Comparing the files, they have the exact same length, sample rate, bit per sample and binary size.
I cannot ear a difference in the files.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151758 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unskip two canvas tests that only fail on Lion

Patch by Benjamin Poulain <bpoulain@apple.com> on 2013-06-19

* platform/mac/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151759 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<rdar://problem/14197983> Rename functions from Bug 117667 and add safeguards for !ENABLE(VIDEO) platforms (117765)
https://bugs.webkit.org/show_bug.cgi?id=117765

Patch by Ruth Fong <ruth_fong@apple.com>.
Reviewed by Brady Eidson.

* WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp:
(WKBundleHitTestResultGetMediaType): Updated to use mediaType().

* WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp:
(WebKit::InjectedBundleHitTestResult::mediaType): Updated.
Renamed getMediaType() to mediaType() and now handles !ENABLE(VIDEO) platforms.

* WebProcess/InjectedBundle/InjectedBundleHitTestResult.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151760 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Incomplete repaint of input elements in writing-mode overflow
https://bugs.webkit.org/show_bug.cgi?id=110246

Patch by Yuki Sekiguchi <yuki.sekiguchi@access-company.com> on 2013-06-19
Reviewed by Simon Fraser.

Source/WebCore:

We calculate repaint rect using unflipped rect.
However, RenderBox::applyCachedClipAndScrollOffsetForRepaint() which is called from repaint rect calculation
wants that its argument rect is flipped.
The reason is:
- paintRect.move(-scrolledContentOffset()); cannot scroll if the rect is unflipped.
- It cannot clip using intersect.
Passing unflipped rect to applyCachedClipAndScrollOffsetForRepaint() cause invalid clipping.
Therefore, this patch flipped the rect at the first part of the function and unflipped it at the last part of the function.

Scroll bar rect is absolute rect, so it is flipped rect.
RenderLayer::invalidateScrollbarRect() pass the rect to repaintRectangle() which expects an argument rect is unflipped.
This cause part of overlapping scroll bar doesn't fade out.
Therefore, this patch flipped the rect and pass it to repaintRectangle().

Tests: fast/repaint/horizontal-bt-overflow-child.html
       fast/repaint/horizontal-bt-overflow-parent.html
       fast/repaint/horizontal-bt-overflow-same.html
       fast/repaint/vertical-overflow-child.html
       fast/repaint/vertical-overflow-parent.html
       fast/repaint/vertical-overflow-same.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::applyCachedClipAndScrollOffsetForRepaint):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::invalidateScrollbarRect):

LayoutTests:

* fast/repaint/horizontal-bt-overflow-child-expected.txt: Added.
* fast/repaint/horizontal-bt-overflow-child.html: Added.
* fast/repaint/horizontal-bt-overflow-parent-expected.txt: Added.
* fast/repaint/horizontal-bt-overflow-parent.html: Added.
* fast/repaint/horizontal-bt-overflow-same-expected.txt: Added.
* fast/repaint/horizontal-bt-overflow-same.html: Added.
* fast/repaint/vertical-overflow-child-expected.txt: Added.
* fast/repaint/vertical-overflow-child.html: Added.
* fast/repaint/vertical-overflow-parent-expected.txt: Added.
* fast/repaint/vertical-overflow-parent.html: Added.
* fast/repaint/vertical-overflow-same-expected.txt: Added.
* fast/repaint/vertical-overflow-same.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151761 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        [Mac] Common crashes when playing media
        https://bugs.webkit.org/show_bug.cgi?id=117813
        <rdar://problem/13837412>

        Reviewed by Eric Carlson.

        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
        (-[WebCoreAVFLoaderDelegate resourceLoader:didCancelLoadingRequest:]):
        This method may be called from a secondary thread, but it does things that are
        not thread safe.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151762 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unskip feSpecularLight-premultiplied.svg on Mountain Lion

Patch by Benjamin Poulain <bpoulain@apple.com> on 2013-06-19

* platform/mac/TestExpectations:
The test is failing on Lion exclusively.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151763 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Windows] AX: Expand notification support.
https://bugs.webkit.org/show_bug.cgi?id=117761

Reviewed by Anders Carlsson.

* DumpRenderTree/win/AccessibilityUIElementWin.cpp:
(AccessibilityUIElement::isPressActionSupported): Provide implementation.
(AccessibilityUIElement::press): Provide implementation.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151764 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Windows] Unreviewed AX test expecation gardening.

* platform/win/accessibility/aria-labelledby-on-input-expected.txt: Added.
* platform/win/accessibility/aria-list-and-listitem-expected.txt: Added.
* platform/win/accessibility/aria-roles-expected.txt: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151765 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Adding a Mac pixel result.

* platform/mac/fast/replaced/width-and-height-of-positioned-replaced-elements-expected.png: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151766 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Expose plug-ins CFBundleShortVersionString in the WKPluginInformation dictionary
https://bugs.webkit.org/show_bug.cgi?id=117816

Reviewed by Geoffrey Garen.

- Adds a new key for the WKPluginInformation dictionary: WKPluginInformationBundleShortVersionKey().

* Shared/API/c/WKPluginInformation.cpp:
(WKPluginInformationBundleShortVersionKey):
* Shared/API/c/WKPluginInformation.h:
* Shared/Plugins/Netscape/PluginInformation.cpp:
(WebKit::pluginInformationBundleShortVersionKey):
* Shared/Plugins/Netscape/PluginInformation.h:
* Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
(WebKit::NetscapePluginModule::getPluginInfo):
* Shared/Plugins/Netscape/mac/PluginInformationMac.mm:
(WebKit::getPlatformPluginModuleInformation):
* Shared/Plugins/PluginModuleInfo.h:


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