Commit 5f519ec9 authored by Morten Stenshorne's avatar Morten Stenshorne Committed by Commit Bot

Element::ClientQuads() needs to take transforms into account.

In LayoutGeometryMap, when there's a non-uniform step (e.g. when inside
multicol), we fall back on doing it the slow way, i.e. we involve
LayoutObject::MapLocalToAncestor(). The mode flags initially passed from
ClientQuads() will just be echoed here, so we need to make sure that
kUseTransforms is specified.

BUG=683925

Change-Id: I2a6fe83fb1332a19a581203d6c44c6924da3f027
Reviewed-on: https://chromium-review.googlesource.com/541339Reviewed-by: default avatarChris harrelson <chrishtr@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#481039}
parent 096d2183
<!DOCTYPE html>
<script src="../resources/ahem.js"></script>
<style>
body { margin:0; }
</style>
<div style="columns:3; width:100px; height:100px; transform:rotate(90deg); font:16px/1 Ahem; background:yellow;">
<span id="elm">XXX</span>
</div>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script>
test(function() {
var rects = document.getElementById("elm").getClientRects();
assert_equals(rects.length, 1);
var rect = rects[0];
assert_equals(rect.left, 84, "left");
assert_equals(rect.top, 0, "top");
assert_equals(rect.right, 100, "right");
assert_equals(rect.bottom, 48, "bottom");
}, "getClientRects of inline in transformed multicol");
</script>
<!DOCTYPE html>
<script src="../resources/ahem.js"></script>
<style>
body { margin:0; }
</style>
<div style="columns:3; width:100px; height:100px; column-fill:auto; font:16px/1 Ahem; background:yellow;">
<span id="elm" style="display:inline-block; transform:translateX(16px) rotate(90deg); transform-origin:top left;">XXX</span>
</div>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script>
test(function() {
var rects = document.getElementById("elm").getClientRects();
assert_equals(rects.length, 1);
var rect = rects[0];
assert_equals(rect.left, 0, "left");
assert_equals(rect.top, 0, "top");
assert_between_inclusive(rect.right, 15.9, 16.1, "right");
assert_between_inclusive(rect.bottom, 47.9, 48.1, "bottom");
}, "getClientRects of transformed atomic inline in multicol");
</script>
...@@ -1234,7 +1234,7 @@ void Element::ClientQuads(Vector<FloatQuad>& quads) { ...@@ -1234,7 +1234,7 @@ void Element::ClientQuads(Vector<FloatQuad>& quads) {
// FIXME: Handle table/inline-table with a caption. // FIXME: Handle table/inline-table with a caption.
if (element_layout_object->IsBoxModelObject() || if (element_layout_object->IsBoxModelObject() ||
element_layout_object->IsBR()) element_layout_object->IsBR())
element_layout_object->AbsoluteQuads(quads); element_layout_object->AbsoluteQuads(quads, kUseTransforms);
} }
ClientRectList* Element::getClientRects() { ClientRectList* Element::getClientRects() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment