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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc.
6 * All rights reserved. 6 * All rights reserved.
7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
10 * (http://www.torchmobile.com/) 10 * (http://www.torchmobile.com/)
(...skipping 21 matching lines...) Expand all
32 32
33 #include "core/HTMLNames.h" 33 #include "core/HTMLNames.h"
34 #include "core/SVGNames.h" 34 #include "core/SVGNames.h"
35 #include "core/dom/ContainerNode.h" 35 #include "core/dom/ContainerNode.h"
36 #include "core/dom/Document.h" 36 #include "core/dom/Document.h"
37 #include "core/dom/Element.h" 37 #include "core/dom/Element.h"
38 #include "core/frame/FrameView.h" 38 #include "core/frame/FrameView.h"
39 #include "core/frame/Settings.h" 39 #include "core/frame/Settings.h"
40 #include "core/frame/UseCounter.h" 40 #include "core/frame/UseCounter.h"
41 #include "core/html/HTMLIFrameElement.h" 41 #include "core/html/HTMLIFrameElement.h"
42 #include "core/html/HTMLImageElement.h"
42 #include "core/html/HTMLInputElement.h" 43 #include "core/html/HTMLInputElement.h"
43 #include "core/html/HTMLPlugInElement.h" 44 #include "core/html/HTMLPlugInElement.h"
44 #include "core/html/HTMLTableCellElement.h" 45 #include "core/html/HTMLTableCellElement.h"
45 #include "core/html/HTMLTextAreaElement.h" 46 #include "core/html/HTMLTextAreaElement.h"
46 #include "core/layout/LayoutTheme.h" 47 #include "core/layout/LayoutTheme.h"
47 #include "core/style/ComputedStyle.h" 48 #include "core/style/ComputedStyle.h"
48 #include "core/style/ComputedStyleConstants.h" 49 #include "core/style/ComputedStyleConstants.h"
49 #include "core/svg/SVGSVGElement.h" 50 #include "core/svg/SVGSVGElement.h"
50 #include "platform/Length.h" 51 #include "platform/Length.h"
51 #include "platform/transforms/TransformOperations.h" 52 #include "platform/transforms/TransformOperations.h"
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 // use normal instead. If the width of the cell is fixed, then 203 // use normal instead. If the width of the cell is fixed, then
203 // we don't actually use NOWRAP. 204 // we don't actually use NOWRAP.
204 if (style.width().isFixed()) 205 if (style.width().isFixed())
205 style.setWhiteSpace(EWhiteSpace::kNormal); 206 style.setWhiteSpace(EWhiteSpace::kNormal);
206 else 207 else
207 style.setWhiteSpace(EWhiteSpace::kNowrap); 208 style.setWhiteSpace(EWhiteSpace::kNowrap);
208 } 209 }
209 return; 210 return;
210 } 211 }
211 212
213 if (isHTMLImageElement(element)) {
214 if (toHTMLImageElement(element).isCollapsed())
215 style.setDisplay(EDisplay::None);
216 return;
217 }
218
212 if (isHTMLTableElement(element)) { 219 if (isHTMLTableElement(element)) {
213 // Tables never support the -webkit-* values for text-align and will reset 220 // Tables never support the -webkit-* values for text-align and will reset
214 // back to the default. 221 // back to the default.
215 if (style.textAlign() == ETextAlign::kWebkitLeft || 222 if (style.textAlign() == ETextAlign::kWebkitLeft ||
216 style.textAlign() == ETextAlign::kWebkitCenter || 223 style.textAlign() == ETextAlign::kWebkitCenter ||
217 style.textAlign() == ETextAlign::kWebkitRight) 224 style.textAlign() == ETextAlign::kWebkitRight)
218 style.setTextAlign(ETextAlign::kStart); 225 style.setTextAlign(ETextAlign::kStart);
219 return; 226 return;
220 } 227 }
221 228
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 style.setDisplay(EDisplay::Block); 496 style.setDisplay(EDisplay::Block);
490 497
491 // Columns don't apply to svg text elements. 498 // Columns don't apply to svg text elements.
492 if (isSVGTextElement(*element)) 499 if (isSVGTextElement(*element))
493 style.clearMultiCol(); 500 style.clearMultiCol();
494 } 501 }
495 adjustStyleForAlignment(style, parentStyle); 502 adjustStyleForAlignment(style, parentStyle);
496 } 503 }
497 504
498 } // namespace blink 505 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698