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

Unified Diff: third_party/WebKit/Source/core/html/HTMLImageElement.cpp

Issue 2627953003: Make `getComputedStyle` return the correct style for collapsed <img> elements. (Closed)
Patch Set: Move logic to StyleAdjuster. Created 3 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/html/HTMLImageElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLImageElement.cpp b/third_party/WebKit/Source/core/html/HTMLImageElement.cpp
index 84a2646a0ba38acb65324f0e90636061ac38ca3b..80c4369931ae3a77906b1736e7b54b7fec49da31 100644
--- a/third_party/WebKit/Source/core/html/HTMLImageElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLImageElement.cpp
@@ -333,11 +333,6 @@ ImageCandidate HTMLImageElement::findBestFitImageFromPictureParent() {
return ImageCandidate();
}
-bool HTMLImageElement::layoutObjectIsNeeded(const ComputedStyle& style) {
- return m_layoutDisposition != LayoutDisposition::Collapsed &&
- HTMLElement::layoutObjectIsNeeded(style);
-}
-
LayoutObject* HTMLImageElement::createLayoutObject(const ComputedStyle& style) {
const ContentData* contentData = style.contentData();
if (contentData && contentData->isImage()) {
@@ -366,7 +361,6 @@ LayoutObject* HTMLImageElement::createLayoutObject(const ComputedStyle& style) {
void HTMLImageElement::attachLayoutTree(const AttachContext& context) {
HTMLElement::attachLayoutTree(context);
-
if (layoutObject() && layoutObject()->isImage()) {
LayoutImage* layoutImage = toLayoutImage(layoutObject());
LayoutImageResource* layoutImageResource = layoutImage->imageResource();
@@ -852,6 +846,10 @@ void HTMLImageElement::ensurePrimaryContent() {
setLayoutDisposition(LayoutDisposition::PrimaryContent);
}
+bool HTMLImageElement::isCollapsed() const {
+ return m_layoutDisposition == LayoutDisposition::Collapsed;
+}
+
void HTMLImageElement::setLayoutDisposition(LayoutDisposition layoutDisposition,
bool forceReattach) {
if (m_layoutDisposition == layoutDisposition && !forceReattach)

Powered by Google App Engine
This is Rietveld 408576698