[chromium] Should accelerate rotations of >= 180 degrees
https://bugs.webkit.org/show_bug.cgi?id=94860

Reviewed by James Robinson.

Source/Platform:

When generalizing the keyframe interpolation, it became useful to append an identity transform operation,
and to ask a WebTransformOperations object if it isIdentity().

* chromium/public/WebTransformOperations.h:
(WebTransformOperations):

Source/WebCore:

WebTransformOperation now stores enough information to interpolate
without resorting to WebTransformationMatrix::blend which is both
expensive, and in the case of big rotations, error prone. For example,
we now store the axis and angle for rotations, so if two rotations are
interpolated, and they are about the same axis, we can simply
interpolate the angles.

Unit tests:
  WebTransformOperationTest.transformTypesAreUnique
  WebTransformOperationTest.matchTypesSameLength
  WebTransformOperationTest.identityAlwaysMatches
  WebTransformOperationTest.largeRotationsWithSameAxis
  WebTransformOperationTest.largeRotationsWithSameAxisInDifferentDirection
  WebTransformOperationTest.largeRotationsWithDifferentAxes
  WebTransformOperationTest.blendRotationFromIdentity
  WebTransformOperationTest.blendTranslationFromIdentity
  WebTransformOperationTest.blendScaleFromIdentity
  WebTransformOperationTest.blendSkewFromIdentity
  WebTransformOperationTest.blendPerspectiveFromIdentity
  WebTransformOperationTest.blendRotationToIdentity
  WebTransformOperationTest.blendTranslationToIdentity
  WebTransformOperationTest.blendScaleToIdentity
  WebTransformOperationTest.blendSkewToIdentity
  WebTransformOperationTest.blendPerspectiveToIdentity
  AnimationTranslationUtilTest.createTransformAnimationWithBigRotation
  AnimationTranslationUtilTest.createTransformAnimationWithBigRotationAndEmptyTransformOperationList

* platform/chromium/support/WebTransformOperations.cpp:
(std):
(WebKit::WebTransformOperation::WebTransformOperation):
(WebTransformOperation):
  Added x y z and angle.
(WebKit::WebTransformOperation::isIdentity):
  Returns true if this->matrix.isIdentity()
(WebKit::isIdentity):
  Returns true if the argument is null or ->isIdentity()
(WebKit):
(WebKit::shareSameAxis):
  A helper function that determines if two transform operations
  share the same axis. Also returns the axis and 'from' angle
  to use in the interpolation (in case the axes point in different
  directions).
(WebKit::blendDoubles):
  Linearly interpolates doubles.
(WebKit::blendTransformOperations):
  Blends two WebTransformOperation objects.
(WebKit::WebTransformOperations::blend):
  Blends two WebTransformOperations objects, taking special care
  when either isIdentity().
(WebKit::WebTransformOperations::matchesTypes):
  Was changed to reflect the fact that identity transform operations
  match anything.
(WebKit::WebTransformOperations::appendTranslate):
(WebKit::WebTransformOperations::appendRotate):
(WebKit::WebTransformOperations::appendScale):
(WebKit::WebTransformOperations::appendSkew):
(WebKit::WebTransformOperations::appendPerspective):
(WebKit::WebTransformOperations::appendIdentity):
  The 'append' functions all populate the new members in
  WebTransformOperation.
(WebKit::WebTransformOperations::isIdentity):
  Returns false iff any of its transform operations !isIdentity().
* platform/graphics/chromium/AnimationTranslationUtil.cpp:
(WebCore::toWebTransformOperations):
(WebCore::WebTransformAnimationCurve):
  Removed the >= 180 degree restriction.

Source/WebKit/chromium:

Added new unit tests:
  WebTransformOperationTest.transformTypesAreUnique
  WebTransformOperationTest.matchTypesSameLength
  WebTransformOperationTest.identityAlwaysMatches
  WebTransformOperationTest.largeRotationsWithSameAxis
  WebTransformOperationTest.largeRotationsWithSameAxisInDifferentDirection
  WebTransformOperationTest.largeRotationsWithDifferentAxes
  WebTransformOperationTest.blendRotationFromIdentity
  WebTransformOperationTest.blendTranslationFromIdentity
  WebTransformOperationTest.blendScaleFromIdentity
  WebTransformOperationTest.blendSkewFromIdentity
  WebTransformOperationTest.blendPerspectiveFromIdentity
  WebTransformOperationTest.blendRotationToIdentity
  WebTransformOperationTest.blendTranslationToIdentity
  WebTransformOperationTest.blendScaleToIdentity
  WebTransformOperationTest.blendSkewToIdentity
  WebTransformOperationTest.blendPerspectiveToIdentity
  AnimationTranslationUtilTest.createTransformAnimationWithBigRotation
  AnimationTranslationUtilTest.createTransformAnimationWithBigRotationAndEmptyTransformOperationList

* tests/AnimationTranslationUtilTest.cpp:
(WebKit::TEST):
* tests/WebTransformOperationsTest.cpp:
(TEST):
(getIdentityOperations):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126838 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r109480): Form state for iframe content is not restored
https://bugs.webkit.org/show_bug.cgi?id=90870

Reviewed by Jochen Eisinger.

Source/WebCore:

Since r109480, we have restored form state only for documents
loaded by FrameLoader::loadItem(). However we should restore form
state for documents in sub-frames of documents loaded by
FrameLoader::loadItem().

Test: fast/loader/form-state-restore-with-frames.html

* history/HistoryItem.cpp:
(WebCore::HistoryItem::isAncestorOf):
Added. A function to search descendants for the specified
HistoryItem. This is used by isAssociatedToRequestedHistoryItem().
* history/HistoryItem.h:
(HistoryItem): Declare isAncestorOf().
* loader/HistoryController.cpp:
(WebCore::HistoryController::saveDocumentState):
Don't save form state for detached document.
This is needed because saveDocumentState() is called twice; before
document detach and after document detach. We need to avoid the
latter call because formElementsState() for a detached document
produces an empty state.
(WebCore::isAssociatedToRequestedHistoryItem):
Added. This function checks the current HistoryItem is associated
to the HistoryItem specified to FrameLoader::loadItem().
(WebCore::HistoryController::restoreDocumentState):
Uses isAssociatedToRequestedHistoryItem().

LayoutTests:

* fast/loader/form-state-restore-with-frames.html: Added.
* fast/loader/form-state-restore-with-frames-expected.txt: Added.
* fast/loader/resources/form-state-restore-with-frames-1.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126839 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=94848
When paged-x/y is specified on the root, columnGap is ignored, and garbage pixels 
are likely

Source/WebCore: 

Reviewed by Dan Bernstein.

We used to call setPagination() from applyOverflowToViewport(), but that is too 
late. We want to setPagination() before we actually lay anything out so that all 
of the styles (including columnGap!) will be properly set on the RenderView. 

No longer handle pagination here since we take care of it in 
applyPaginationToViewport()        
* page/FrameView.cpp:
(WebCore::FrameView::applyOverflowToViewport):

New function to call setPagination(). This function gets the appropriate renderer 
and uses its RenderStyle to determine if pagination should be set.
(WebCore::FrameView::applyPaginationToViewport):
(WebCore):

Call applyPaginationToViewport() before the call to updateStyleIfNeeded().
(WebCore::FrameView::layout):

This code was meant to prevent garbage pixels in column gaps for pagination on the 
RenderView, but paintContents() does not always get called when we paint into 
tiles, so I moved this code to RenderView.
(WebCore::FrameView::paintContents):
* page/FrameView.h:
(FrameView):

The code from RenderView::paintContents() to prevent garbage pixels is moved here.
* rendering/RenderView.cpp:
(WebCore::RenderView::paint):

LayoutTests: 

Reviewed by Dan Bernsetin.

New tests.
* fast/overflow/paged-x-div-with-column-gap.html: Added.
* fast/overflow/paged-x-with-column-gap.html: Added.
* platform/mac/fast/overflow/paged-x-div-with-column-gap-expected.png: Added.
* platform/mac/fast/overflow/paged-x-div-with-column-gap-expected.txt: Added.
* platform/mac/fast/overflow/paged-x-with-column-gap-expected.png: Added.
* platform/mac/fast/overflow/paged-x-with-column-gap-expected.txt: Added.

Updated results needed for Chromium.
* platform/chromium/TestExpectations:



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