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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutMedia.cpp

Issue 1653673002: Even more explicit LayoutUnit conversion (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@moarConstructors
Patch Set: address comments Created 4 years, 11 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
Index: third_party/WebKit/Source/core/layout/LayoutMedia.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutMedia.cpp b/third_party/WebKit/Source/core/layout/LayoutMedia.cpp
index dddb3e24d99ebd556730b865256942e3a5ce6444..b6bc79420e6cb9a344488639c75704dc5dc3e88f 100644
--- a/third_party/WebKit/Source/core/layout/LayoutMedia.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutMedia.cpp
@@ -52,7 +52,7 @@ void LayoutMedia::layout()
LayoutImage::layout();
- LayoutSize newSize = contentBoxRect().size();
+ LayoutRect newRect = contentBoxRect();
LayoutState state(*this, locationOffset());
@@ -73,23 +73,23 @@ void LayoutMedia::layout()
ASSERT_NOT_REACHED();
#endif
- if (newSize == oldSize && !child->needsLayout())
+ if (newRect.size() == oldSize && !child->needsLayout())
continue;
LayoutBox* layoutBox = toLayoutBox(child);
- layoutBox->setLocation(LayoutPoint(borderLeft(), borderTop()) + LayoutSize(paddingLeft(), paddingTop()));
+ layoutBox->setLocation(newRect.location());
// TODO(philipj): Remove the mutableStyleRef() and depend on CSS
// width/height: inherit to match the media element size.
- layoutBox->mutableStyleRef().setHeight(Length(newSize.height(), Fixed));
- layoutBox->mutableStyleRef().setWidth(Length(newSize.width(), Fixed));
+ layoutBox->mutableStyleRef().setHeight(Length(newRect.height(), Fixed));
+ layoutBox->mutableStyleRef().setWidth(Length(newRect.width(), Fixed));
layoutBox->forceLayout();
}
clearNeedsLayout();
// Notify our MediaControls that a layout has happened.
- if (mediaElement() && mediaElement()->mediaControls() && newSize.width() != oldSize.width())
- mediaElement()->mediaControls()->notifyPanelWidthChanged(newSize.width());
+ if (mediaElement() && mediaElement()->mediaControls() && newRect.width() != oldSize.width())
+ mediaElement()->mediaControls()->notifyPanelWidthChanged(newRect.width());
}
bool LayoutMedia::isChildAllowed(LayoutObject* child, const ComputedStyle&) const
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutListMarker.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutReplaced.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698