summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/core/layout/layout_vtt_cue.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/blink/renderer/core/layout/layout_vtt_cue.cc')
-rw-r--r--chromium/third_party/blink/renderer/core/layout/layout_vtt_cue.cc27
1 files changed, 8 insertions, 19 deletions
diff --git a/chromium/third_party/blink/renderer/core/layout/layout_vtt_cue.cc b/chromium/third_party/blink/renderer/core/layout/layout_vtt_cue.cc
index 722895a6a52..fa49a3ec625 100644
--- a/chromium/third_party/blink/renderer/core/layout/layout_vtt_cue.cc
+++ b/chromium/third_party/blink/renderer/core/layout/layout_vtt_cue.cc
@@ -117,27 +117,16 @@ LayoutUnit SnapToLinesLayouter::ComputeInitialPositionAdjustment(
// are relative to the same coordinate space. If we didn't the (bounding) boxes
// could be affect by transforms on an ancestor et.c, which could yield
// incorrect results.
-IntRect ContentBoxRelativeToAncestor(const LayoutBox& box,
- const LayoutBoxModelObject& ancestor) {
- PhysicalRect cue_content_box = box.PhysicalContentBoxRect();
+IntRect BorderBoxRelativeToAncestor(const LayoutBox& box,
+ const LayoutBoxModelObject& ancestor) {
+ PhysicalRect border_box = box.PhysicalBorderBoxRect();
// We pass UseTransforms here primarily because we use a transform for
// non-snap-to-lines positioning (see VTTCue.cpp.)
- return EnclosingIntRect(box.LocalToAncestorRect(cue_content_box, &ancestor));
-}
-
-// Similar to above except uses the full bounding box instead of just the
-// context box (which ignores padding). This is used for the timeline since the
-// timeline is mostly padding.
-IntRect PaddingBoxRelativeToAncestor(const LayoutBox& box,
- const LayoutBoxModelObject& ancestor) {
- PhysicalRect cue_content_box = box.PhysicalPaddingBoxRect();
- // We pass UseTransforms here primarily because we use a transform for
- // non-snap-to-lines positioning (see VTTCue.cpp.)
- return EnclosingIntRect(box.LocalToAncestorRect(cue_content_box, &ancestor));
+ return EnclosingIntRect(box.LocalToAncestorRect(border_box, &ancestor));
}
IntRect CueBoundingBox(const LayoutBox& cue_box) {
- return ContentBoxRelativeToAncestor(cue_box, *cue_box.ContainingBlock());
+ return BorderBoxRelativeToAncestor(cue_box, *cue_box.ContainingBlock());
}
bool SnapToLinesLayouter::IsOutside(const IntRect& title_area) const {
@@ -232,7 +221,7 @@ void SnapToLinesLayouter::UpdateLayout() {
// rendering area except for a width of margin at the left of the rendering
// area and a width of margin at the right of the rendering area.
IntRect title_area =
- EnclosingIntRect(cue_box_.ContainingBlock()->PhysicalContentBoxRect());
+ EnclosingIntRect(cue_box_.ContainingBlock()->PhysicalBorderBoxRect());
if (blink::IsHorizontalWritingMode(writing_mode)) {
title_area.Move(0, margin.ToInt());
title_area.Contract(0, (2 * margin).ToInt());
@@ -359,10 +348,10 @@ IntRect LayoutVTTCue::ComputeControlsRect() const {
return IntRect();
}
- IntRect button_panel_box = ContentBoxRelativeToAncestor(
+ IntRect button_panel_box = BorderBoxRelativeToAncestor(
ToLayoutBox(*button_panel_layout_object),
ToLayoutBox(*controls->ContainerLayoutObject()));
- IntRect timeline_box = PaddingBoxRelativeToAncestor(
+ IntRect timeline_box = BorderBoxRelativeToAncestor(
ToLayoutBox(*timeline_layout_object),
ToLayoutBox(*controls->ContainerLayoutObject()));