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

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: 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/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 4485c4037c23e6ac7fffd130c8a1e04d2d35128f..ca7aeac8ecc5b495d1b66ea7fac058efc912199d 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"
@@ -208,6 +209,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