REGRESSION (r159276): Fix lots of crashes for sh4 architecture.
https://bugs.webkit.org/show_bug.cgi?id=124347

Patch by Julien Brianceau <jbriance@cisco.com> on 2013-11-14
Reviewed by Michael Saboff.

Since r159276, we have (t4 == a0 == r4) and (t5 == a1 == r5) in LLINT for sh4.
This leads to argument register trampling in cCallX macros, especially with cCall2
macro when arg1 == t4.

* llint/LowLevelInterpreter32_64.asm: Use a new "setargs" pseudo-op to setup arguments for sh4.
* offlineasm/instructions.rb:
* offlineasm/sh4.rb: Lower "setargs" pseudo-op to setup argument registers and prevent register trampling issues.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159288 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Cleaner Backend Method Calling Code Generation
https://bugs.webkit.org/show_bug.cgi?id=124333

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2013-11-14
Reviewed by Timothy Hatcher.

No change in functionality, just improved generated code.

* inspector/CodeGeneratorInspector.py:
(Generator.process_command):
* inspector/CodeGeneratorInspectorStrings.py:
* inspector/InspectorBackendDispatcher.cpp:
* inspector/InspectorBackendDispatcher.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159289 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION (r159276): rbp register overwritten in Win 64 version of callToJavascript stub
https://bugs.webkit.org/show_bug.cgi?id=124361

Reviewed by Oliver Hunt.

Swapped operand ordering to: mov rax, rbp

* jit/JITStubsMSVC64.asm:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159290 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Shapes] Empty polygons with non-zero shape-padding cause an ASSERT crash
https://bugs.webkit.org/show_bug.cgi?id=124324

Reviewed by Andreas Kling.

Source/WebCore:

PolygonShape::shapePaddingBounds() and PolygonShape::shapeMarginBounds() no
longer attempt to compute a new FloatPolygon when the original is empty, i.e.
when it has less than three vertices.

Tests: fast/shapes/shape-inside/shape-inside-empty-polygon-crash.html
       fast/shapes/shape-outside-floats/shape-outside-floats-empty-polygon-crash.html

* rendering/shapes/PolygonShape.cpp:
(WebCore::PolygonShape::shapePaddingBounds): Don't compute a padding FloatPolygon if the original polygon is empty.
(WebCore::PolygonShape::shapeMarginBounds): Don't compute a margin FloatPolygon if the original polygon is empty.

LayoutTests:

* fast/shapes/shape-inside/shape-inside-empty-polygon-crash-expected.txt: Added.
* fast/shapes/shape-inside/shape-inside-empty-polygon-crash.html: Added.
* fast/shapes/shape-outside-floats/shape-outside-floats-empty-polygon-crash-expected.txt: Added.
* fast/shapes/shape-outside-floats/shape-outside-floats-empty-polygon-crash.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Implement RSASSA-PKCS1-v1_5 sign/verify
https://bugs.webkit.org/show_bug.cgi?id=124335

Reviewed by Sam Weinig.

Source/WebCore:

Test: crypto/subtle/rsassa-pkcs1-v1_5-sign-verify.html

* WebCore.xcodeproj/project.pbxproj: Added new files, removed Mac SHA algorithm files.

* crypto/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
(WebCore::getCommonCryptoDigestAlgorithm):
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::sign):
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::verify):
Implemented. These take two steps, first a digest is computed, and then it's signed.

* crypto/CryptoDigest.h: Added.
* crypto/mac/CryptoDigestMac.cpp: Added.
(WebCore::CryptoDigest::CryptoDigest):
(WebCore::CryptoDigest::~CryptoDigest):
(WebCore::CryptoDigest::create):
(WebCore::CryptoDigest::addBytes):
(WebCore::CryptoDigest::computeHash):
Added a cross-platform interface and Mac implementation to compute a digest. It
should be possible to use it outside WebCrypto if we need to (perhaps even merge
with  WTF SHA-1 class).
The Mac implementation is kind of ugly, but at least it encapsulates the ugliness.

* crypto/algorithms/CryptoAlgorithmSHA1.cpp: (WebCore::CryptoAlgorithmSHA1::digest):
* crypto/algorithms/CryptoAlgorithmSHA224.cpp: (WebCore::CryptoAlgorithmSHA224::digest):
* crypto/algorithms/CryptoAlgorithmSHA256.cpp: (WebCore::CryptoAlgorithmSHA256::digest):
* crypto/algorithms/CryptoAlgorithmSHA384.cpp: (WebCore::CryptoAlgorithmSHA384::digest):
* crypto/algorithms/CryptoAlgorithmSHA512.cpp: (WebCore::CryptoAlgorithmSHA512::digest):
* crypto/mac/CryptoAlgorithmSHA1Mac.cpp: Removed.
* crypto/mac/CryptoAlgorithmSHA224Mac.cpp: Removed.
* crypto/mac/CryptoAlgorithmSHA256Mac.cpp: Removed.
* crypto/mac/CryptoAlgorithmSHA384Mac.cpp: Removed.
* crypto/mac/CryptoAlgorithmSHA512Mac.cpp: Removed.
These are all cross-platform now.

LayoutTests:

* crypto/subtle/rsassa-pkcs1-v1_5-sign-verify-expected.txt: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-sign-verify.html: Added.


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

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159294 268f45cc-cd09-0410-ab3c-d52691b4dbfc
AX: Calling NSAccessibilityColumnsAttribute and NSAccessibilityRowsAttribute simply to get column/row count can be very expensive.
https://bugs.webkit.org/show_bug.cgi?id=124293

Reviewed by Chris Fleizach.

Source/WebCore:

Added ability to get accessibility table column or row count without fetching all columns or rows.

Test: platform/mac/accessibility/table-column-and-row-count.html

* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):

LayoutTests:

Added test to ensure NSAccessibilityColumnsAttribute and NSAccessibilityRowsAttribute
behave as expected. Also updated existing table tests to reflect this additional API.

* platform/mac/accessibility/table-column-and-row-count-expected.txt: Added.
* platform/mac/accessibility/table-column-and-row-count.html: Added.
* platform/mac/accessibility/table-detection-expected.txt:
* platform/mac/accessibility/table-with-rules-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159295 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Implement RSASSA-PKCS1-v1_5 sign/verify
https://bugs.webkit.org/show_bug.cgi?id=124335

Build fix.

* crypto/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159296 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove duplicate entry.

* Scripts/webkitpy/common/config/contributors.json:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159297 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION (r159276): Fix lots of crashes for arm_traditional architecture.
https://bugs.webkit.org/show_bug.cgi?id=124365

Reviewed by Oliver Hunt.

Crashes were caused by a mixup between regular registers and temporary registers in ARM_EXTRA_GPRS.

* llint/LowLevelInterpreter32_64.asm: Warning, t3 != a3. It's safer to use an implementation using aX
registers like the MIPS one for cCallX macros.
* offlineasm/arm.rb: Rearrange ARM_EXTRA_GPRS according to the new register distribution in LLINT.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159298 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Mac] HMAC sign/verify crashes when key is empty
https://bugs.webkit.org/show_bug.cgi?id=124372

Reviewed by Sam Weinig.

Source/WebCore: 

Test: crypto/subtle/hmac-sign-verify-empty-key.html

* crypto/mac/CryptoAlgorithmHMACMac.cpp: (WebCore::calculateSignature): Give it
a non-null pointer then.

LayoutTests: 

* crypto/subtle/hmac-sign-verify-empty-key-expected.txt: Added.
* crypto/subtle/hmac-sign-verify-empty-key.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159299 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add a new mode where fixed elements don't constrain their positions during a
rubber band
https://bugs.webkit.org/show_bug.cgi?id=124260

Reviewed by Tim Horton.

This patch adds a new enum called ScrollBehaviorForFixedElements, which has
two values, StickToDocumentBounds or StickToWindowBounds. StickToDocumentBounds 
corresponds to our current behavior, where fixed elements constrain 
their positions during a rubber-band so that they stay stuck to the document.
The new mode, StickToWindowBounds, will cause fixed elements to always stay
fixed relative to the window.

scrollOffsetForFixedPosition() now takes a new parameter for the fixed behavior
so that it knows whether or not to constrain the position.
* page/FrameView.cpp:
(WebCore::FrameView::scrollOffsetForFixedPosition):
        
Right now, just return StickToDocumentBounds and retain existing behavior.
(WebCore::FrameView::scrollBehaviorForFixedElements):
* page/FrameView.h:

The scrolling thread needs to know about the fixed element scroll behavior,
so this code makes ScrollingStateScrollingNodes keep track of that 
information to pass over to the scrolling thread.
* page/scrolling/ScrollingStateScrollingNode.cpp:
(WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
(WebCore::ScrollingStateScrollingNode::setScrollBehaviorForFixedElements):
* page/scrolling/ScrollingStateScrollingNode.h:
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::ScrollingTreeScrollingNode):
(WebCore::ScrollingTreeScrollingNode::updateBeforeChildren):
* page/scrolling/ScrollingTreeScrollingNode.h:
(WebCore::ScrollingTreeScrollingNode::scrollBehaviorForFixedElements):
* page/scrolling/mac/ScrollingCoordinatorMac.h:
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::frameViewRootLayerDidChange):
(WebCore::ScrollingCoordinatorMac::setScrollBehaviorForFixedElementsForNode):
* page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm:
(WebCore::ScrollingTreeScrollingNodeMac::setScrollLayerPosition):
        
Here is the new enum.
* platform/ScrollTypes.h:
        
Another place where we only want to constrain scroll position if that is the
mode we are in.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::customPositionForVisibleRectComputation):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159300 268f45cc-cd09-0410-ab3c-d52691b4dbfc
http/tests/security/frameNavigation/xss-DENIED-plugin-navigation.html is slow, frequently > 30 second timeout
https://bugs.webkit.org/show_bug.cgi?id=124373

* platform/mac/TestExpectations:
Mark test as slow on Mountain Lion Release bot.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159301 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed build failure; update MediaPlayerPrivateAVFFoundationCF::seekToTime after r159208.

After r159208, seekToTime takes tolerance parameters.

Patch by Jer Noble <jer.noble@apple.com> on 2013-11-13

* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::MediaPlayerPrivateAVFoundationCF::seekToTime):
(WebCore::AVFWrapper::seekToTime):
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159302 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rubber-stamped by Tim Horton.

Post-checkin review comment! StickToViewportBounds sounds better and more accurate 
than StickToWindowBounds.

* platform/ScrollTypes.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159303 268f45cc-cd09-0410-ab3c-d52691b4dbfc
fullscreen/anonymous-block-merge-crash.html often times out in WebKit1
https://bugs.webkit.org/show_bug.cgi?id=124318

* platform/mac/TestExpectations:
Used the wrong kind of failure for a notifyDone timeout.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159304 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Stop using deprecated NSPropertyListSerialization methods
https://bugs.webkit.org/show_bug.cgi?id=124377

Reviewed by Mark Rowe.

* History/WebHistory.mm:
(-[WebHistoryPrivate loadHistoryGutsFromURL:savedItemsCount:collectDiscardedItemsInto:error:]):
* Plugins/Hosted/NetscapePluginHostManager.mm:
(WebKit::NetscapePluginHostManager::spawnPluginHost):
(WebKit::NetscapePluginHostManager::instantiatePlugin):
* Plugins/Hosted/NetscapePluginHostProxy.mm:
(WKPCIdentifierInfo):
* Plugins/Hosted/NetscapePluginInstanceProxy.mm:
(WebKit::NetscapePluginInstanceProxy::enumerate):
(WebKit::NetscapePluginInstanceProxy::marshalValue):
(WebKit::NetscapePluginInstanceProxy::marshalValues):
(WebKit::NetscapePluginInstanceProxy::demarshalValue):
(WebKit::NetscapePluginInstanceProxy::demarshalValues):
* Plugins/Hosted/ProxyInstance.mm:
(WebKit::ProxyInstance::getPropertyNames):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159305 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Flaky Test: media/video-fast-seek.html
https://bugs.webkit.org/show_bug.cgi?id=124298

Reviewed by Eric Carlson.

Don't check for the precise results of currentTime, as MediaTime -> double
rounding will occasionally result in errors.

* media/video-fast-seek-expected.txt:
* media/video-fast-seek.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159306 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Shapes] Accept the new <box> value for shape-outside
https://bugs.webkit.org/show_bug.cgi?id=124227

Reviewed by David Hyatt.

Source/WebCore:

The shape-outside property can now be set to the box values [margin/border/padding/content]-box.
This patch adds the parsing code required to accept the new values, and the layout code
to create a rectangle shape that has the size and position of the appropriate box.

Tests: fast/shapes/shape-outside-floats/shape-outside-boxes-001.html
       fast/shapes/shape-outside-floats/shape-outside-boxes-002.html
       fast/shapes/shape-outside-floats/shape-outside-boxes-003.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue): Output the new box values.
* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue): Accept the new box values.
* css/CSSValueKeywords.in: Add margin-box value.
* css/DeprecatedStyleBuilder.cpp:
(WebCore::ApplyPropertyShape::applyValue): Accept the new box values.
* rendering/RenderBoxModelObject.h:
(WebCore::RenderBoxModelObject::borderLogicalWidth): Added new utility methods to help
with box sizing.
(WebCore::RenderBoxModelObject::borderLogicalHeight): Ditto.
(WebCore::RenderBoxModelObject::paddingLogicalWidth): Ditto.
(WebCore::RenderBoxModelObject::paddingLogicalHeight): Ditto.
* rendering/shapes/Shape.cpp:
(WebCore::Shape::createShape): You can create a shape from a box's dimensions, rather
than always using a BasicShape or RasterShape value.
* rendering/shapes/Shape.h:
* rendering/shapes/ShapeInfo.cpp:
(WebCore::::computedShape): Create the appropriate shape based on the box values.
* rendering/shapes/ShapeInfo.h:
(WebCore::ShapeInfo::setShapeSize): Adjust for the box size when using a box value.
(WebCore::ShapeInfo::logicalTopOffset): Ditto.
(WebCore::ShapeInfo::logicalLeftOffset): Ditto.
* rendering/shapes/ShapeInsideInfo.cpp:
(WebCore::ShapeInsideInfo::isEnabledFor): Enable for the box values.
* rendering/shapes/ShapeOutsideInfo.cpp:
(WebCore::ShapeOutsideInfo::isEnabledFor): Disable for shape-inside.
* rendering/style/ShapeValue.h:
(WebCore::ShapeValue::createBoxValue): Create the appropriate shape value for a box.
(WebCore::ShapeValue::box): Return the box value for this ShapeValue.
(WebCore::ShapeValue::ShapeValue): Create a ShapeValue from a box value.

LayoutTests:

Test the different box values with different writing modes.

* fast/shapes/parsing/parsing-shape-inside-expected.html: Adding box values as invalid.
* fast/shapes/parsing/parsing-shape-inside.html: Ditto.
* fast/shapes/parsing/parsing-shape-outside-expected.html: Adding box values as valid.
* fast/shapes/parsing/parsing-shape-outside.html: Ditto.
* fast/shapes/shape-outside-floats/shape-outside-boxes-001-expected.html: Added.
* fast/shapes/shape-outside-floats/shape-outside-boxes-001.html: Added.
* fast/shapes/shape-outside-floats/shape-outside-boxes-002-expected.html: Added.
* fast/shapes/shape-outside-floats/shape-outside-boxes-002.html: Added.
* fast/shapes/shape-outside-floats/shape-outside-boxes-003-expected.html: Added.
* fast/shapes/shape-outside-floats/shape-outside-boxes-003.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159307 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Simply generated domain dispatch methods for domains with few commands
https://bugs.webkit.org/show_bug.cgi?id=124374

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2013-11-14
Reviewed by Timothy Hatcher.

* inspector/CodeGeneratorInspector.py:
(Generator.go):
(Generator.process_command):
* inspector/CodeGeneratorInspectorStrings.py:

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