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

Unified Diff: third_party/WebKit/Source/core/css/resolver/StyleAdjuster.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
Index: third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp b/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp
index 291b8c727d87bf5be3c24bfac9a91e1c6f4eb798..127e05c930c7092e5c882155c9ac68d0d255469f 100644
--- a/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp
@@ -39,6 +39,7 @@
#include "core/frame/Settings.h"
#include "core/frame/UseCounter.h"
#include "core/html/HTMLIFrameElement.h"
+#include "core/html/HTMLImageElement.h"
#include "core/html/HTMLInputElement.h"
#include "core/html/HTMLPlugInElement.h"
#include "core/html/HTMLTableCellElement.h"
@@ -209,6 +210,12 @@ static void adjustStyleForHTMLElement(ComputedStyle& style,
return;
}
+ if (isHTMLImageElement(element)) {
+ if (toHTMLImageElement(element).isCollapsed())
+ style.setDisplay(EDisplay::None);
+ return;
+ }
+
if (isHTMLTableElement(element)) {
// Tables never support the -webkit-* values for text-align and will reset
// back to the default.

Powered by Google App Engine
This is Rietveld 408576698