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

Unified Diff: third_party/WebKit/Source/core/css/resolver/SharedStyleFinder.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/SharedStyleFinder.cpp
diff --git a/third_party/WebKit/Source/core/css/resolver/SharedStyleFinder.cpp b/third_party/WebKit/Source/core/css/resolver/SharedStyleFinder.cpp
index 27dc1c6c58c3e139f572f5bbfcee5b5c120a0c70..6c0529d8398a6af248d1e0b841d7f70320b7fbf0 100644
--- a/third_party/WebKit/Source/core/css/resolver/SharedStyleFinder.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/SharedStyleFinder.cpp
@@ -45,6 +45,7 @@
#include "core/dom/shadow/ElementShadow.h"
#include "core/dom/shadow/InsertionPoint.h"
#include "core/html/HTMLElement.h"
+#include "core/html/HTMLImageElement.h"
#include "core/html/HTMLInputElement.h"
#include "core/html/HTMLOptGroupElement.h"
#include "core/html/HTMLOptionElement.h"
@@ -286,6 +287,12 @@ bool SharedStyleFinder::canShareStyleWithElement(Element& candidate) const {
if (candidate.isHTMLElement() && toHTMLElement(candidate).hasDirectionAuto())
return false;
+ if (isHTMLImageElement(candidate) && isHTMLImageElement(element()) &&
+ toHTMLImageElement(candidate).isCollapsed() !=
+ toHTMLImageElement(element()).isCollapsed()) {
+ return false;
+ }
+
if (candidate.isLink() && m_context.elementLinkState() != style->insideLink())
return false;

Powered by Google App Engine
This is Rietveld 408576698