https://bugs.webkit.org/show_bug.cgi?id=143655
Source/WebCore:
rdar://problem/
15020044
Reviewed by Darin Adler.
Our "don't do layout if transform changes" code was too aggressive.
If an element changes between having a transform and not having one, we
really need to do a layout since so much else depends on transforms. In
this particular case, we clip position:fixed elements to the viewport if
they are not transformed, and were failing to re-evaluate this when a
transform was added. Doing a layout fixes this.
Test: compositing/geometry/fixed-transformed.html
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::changeRequiresLayout):
* rendering/style/StyleTransformData.h:
(WebCore::StyleTransformData::hasTransform):
LayoutTests:
Reviewed by Darin Adler.
Test that moves a position:fixed element on-screen using a transform.
* compositing/geometry/fixed-transformed.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@182743
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2015-04-13 Simon Fraser <simon.fraser@apple.com>
+
+ Fixed position element is truncated if moved onscreen by a transform
+ https://bugs.webkit.org/show_bug.cgi?id=143655
+
+ Reviewed by Darin Adler.
+
+ Test that moves a position:fixed element on-screen using a transform.
+
+ * compositing/geometry/fixed-transformed.html: Added.
+
2015-04-13 Alexey Proskuryakov <ap@apple.com>
js/regress-141098.html often times out in debug builds.
--- /dev/null
+<!DOCTYPE html>
+
+<html>
+<head>
+ <style>
+ #slider {
+ position: fixed;
+ top: 100px;
+ left: -100px;
+ width: 200px;
+ height: 100px;
+ background-color: blue;
+ border: 10px solid gray;
+ }
+ #slider.out {
+ -webkit-transform: translateX(100px);
+ }
+ </style>
+ <script>
+ if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+ }
+ window.addEventListener('load', function() {
+ window.setTimeout(function() {
+ document.getElementById('slider').classList.add('out');
+ if (window.testRunner) {
+ document.getElementById('layertree').innerText = window.internals.layerTreeAsText(document);
+ testRunner.notifyDone();
+ }
+ }, 0);
+ }, false);
+
+ </script>
+</head>
+<body>
+<div id="slider"></div>
+<pre id="layertree"></pre>
+</body>
+</html>
+2015-04-13 Simon Fraser <simon.fraser@apple.com>
+
+ Fixed position element is truncated if moved onscreen by a transform
+ https://bugs.webkit.org/show_bug.cgi?id=143655
+ rdar://problem/15020044
+
+ Reviewed by Darin Adler.
+
+ Our "don't do layout if transform changes" code was too aggressive.
+ If an element changes between having a transform and not having one, we
+ really need to do a layout since so much else depends on transforms. In
+ this particular case, we clip position:fixed elements to the viewport if
+ they are not transformed, and were failing to re-evaluate this when a
+ transform was added. Doing a layout fixes this.
+
+ Test: compositing/geometry/fixed-transformed.html
+
+ * rendering/style/RenderStyle.cpp:
+ (WebCore::RenderStyle::changeRequiresLayout):
+ * rendering/style/StyleTransformData.h:
+ (WebCore::StyleTransformData::hasTransform):
+
2015-04-12 Darin Adler <darin@apple.com>
[Cocoa] Localizable strings are inconsistent and need to be regenerated
&& *rareNonInheritedData->m_multiCol.get() != *other.rareNonInheritedData->m_multiCol.get())
return true;
- if (rareNonInheritedData->m_transform.get() != other.rareNonInheritedData->m_transform.get()
- && *rareNonInheritedData->m_transform.get() != *other.rareNonInheritedData->m_transform.get()) {
- changedContextSensitiveProperties |= ContextSensitivePropertyTransform;
- // Don't return; keep looking for another change
+ if (rareNonInheritedData->m_transform != other.rareNonInheritedData->m_transform) {
+ if (rareNonInheritedData->m_transform->hasTransform() != other.rareNonInheritedData->m_transform->hasTransform())
+ return true;
+ if (*rareNonInheritedData->m_transform != *other.rareNonInheritedData->m_transform) {
+ changedContextSensitiveProperties |= ContextSensitivePropertyTransform;
+ // Don't return; keep looking for another change
+ }
}
#if ENABLE(CSS_GRID_LAYOUT)
{
return !(*this == o);
}
+
+ bool hasTransform() const { return m_operations.size(); }
TransformOperations m_operations;
Length m_x;