Chromium Code Reviews

Unified Diff: Source/core/layout/LayoutVTTCue.cpp

Issue 1314613002: Drop LayoutVTTCue::adjustForTopAndBottomMarginBorderAndPadding (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Drop seagulls. Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « Source/core/layout/LayoutVTTCue.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutVTTCue.cpp
diff --git a/Source/core/layout/LayoutVTTCue.cpp b/Source/core/layout/LayoutVTTCue.cpp
index 4868661505bff8725b3a4d2852fdc245586f1ea4..319a5b6a2a6280685ad553bf350aed1e65fcdc79 100644
--- a/Source/core/layout/LayoutVTTCue.cpp
+++ b/Source/core/layout/LayoutVTTCue.cpp
@@ -273,30 +273,6 @@ void LayoutVTTCue::repositionCueSnapToLinesNotSet()
// boxes will unfortunately overlap.)
}
-void LayoutVTTCue::adjustForTopAndBottomMarginBorderAndPadding()
-{
- // Accommodate extra top and bottom padding, border or margin.
- // Note: this is supported only for internal UA styling, not through the cue selector.
- if (!hasInlineDirectionBordersPaddingOrMargin())
- return;
- IntRect containerRect = containingBlock()->absoluteBoundingBoxRect();
- IntRect cueRect = absoluteBoundingBoxRect();
-
- int topOverflow = cueRect.y() - containerRect.y();
- int bottomOverflow = containerRect.y() + containerRect.height() - cueRect.y() - cueRect.height();
-
- int adjustment = 0;
- if (topOverflow < 0)
- adjustment = -topOverflow;
- else if (bottomOverflow < 0)
- adjustment = bottomOverflow;
-
- if (!adjustment)
- return;
-
- setY(location().y() + adjustment);
-}
-
void LayoutVTTCue::layout()
{
LayoutBlockFlow::layout();
@@ -319,13 +295,10 @@ void LayoutVTTCue::layout()
}
// http://dev.w3.org/html5/webvtt/#dfn-apply-webvtt-cue-settings - step 13.
- if (!std::isnan(m_snapToLinesPosition)) {
+ if (!std::isnan(m_snapToLinesPosition))
SnapToLinesLayouter(*this, controlsRect).layout();
-
- adjustForTopAndBottomMarginBorderAndPadding();
- } else {
+ else
repositionCueSnapToLinesNotSet();
- }
}
} // namespace blink
« no previous file with comments | « Source/core/layout/LayoutVTTCue.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine