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

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: Rebase. Created 3 years, 10 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 | « third_party/WebKit/Source/core/html/HTMLImageElement.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e779e7be54a631ed36c838a0d943ece4d8e03b2b..a574c90babc57617f521a2b050dc7ace90e4d29a 100644
--- a/third_party/WebKit/Source/core/html/HTMLImageElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLImageElement.cpp
@@ -334,11 +334,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()) {
@@ -367,7 +362,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();
@@ -853,6 +847,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)
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLImageElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698