Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Unified Diff: Source/core/html/track/TextTrackContainer.cpp

Issue 994063003: Move TextTrackContainer::updateSizes to the layout-side (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/track/TextTrackContainer.h ('k') | Source/core/layout/LayoutTextTrackContainer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/track/TextTrackContainer.cpp
diff --git a/Source/core/html/track/TextTrackContainer.cpp b/Source/core/html/track/TextTrackContainer.cpp
index 36335c4bc2d26ef3da15827c3b39bc156bd91bcf..22f276c85fd53416eabf442a13b3703756f06de6 100644
--- a/Source/core/html/track/TextTrackContainer.cpp
+++ b/Source/core/html/track/TextTrackContainer.cpp
@@ -33,13 +33,11 @@
#include "core/html/HTMLVideoElement.h"
#include "core/html/track/CueTimeline.h"
#include "core/layout/LayoutTextTrackContainer.h"
-#include "core/layout/LayoutVideo.h"
namespace blink {
TextTrackContainer::TextTrackContainer(Document& document)
: HTMLDivElement(document)
- , m_fontSize(0)
{
}
@@ -123,31 +121,4 @@ void TextTrackContainer::updateDisplay(HTMLMediaElement& mediaElement)
setInlineStyleProperty(CSSPropertyDisplay, CSSValueNone);
}
-void TextTrackContainer::updateSizes(LayoutObject* mediaElementLayoutObject)
-{
- if (!document().isActive())
- return;
-
- if (!mediaElementLayoutObject || !mediaElementLayoutObject->isVideo())
- return;
-
- // FIXME: The video size is used to calculate the font size (a workaround
- // for lack of per-spec vh/vw support) but the whole media element is used
- // for cue rendering. This is inconsistent. See also the somewhat related
- // spec bug: https://www.w3.org/Bugs/Public/show_bug.cgi?id=28105
- IntSize videoSize = toLayoutVideo(mediaElementLayoutObject)->videoBox().size();
-
- if (m_videoSize == videoSize)
- return;
- m_videoSize = videoSize;
-
- float smallestDimension = std::min(m_videoSize.height(), m_videoSize.width());
-
- float fontSize = smallestDimension * 0.05f;
- if (fontSize != m_fontSize) {
- m_fontSize = fontSize;
- setInlineStyleProperty(CSSPropertyFontSize, fontSize, CSSPrimitiveValue::CSS_PX);
- }
-}
-
} // namespace blink
« no previous file with comments | « Source/core/html/track/TextTrackContainer.h ('k') | Source/core/layout/LayoutTextTrackContainer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698