OLD | NEW |
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.
All rights reserved. | 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc.
All rights reserved. |
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> | 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> |
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. | 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. |
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
(...skipping 16 matching lines...) Expand all Loading... |
27 */ | 27 */ |
28 | 28 |
29 #include "config.h" | 29 #include "config.h" |
30 #include "core/css/resolver/StyleAdjuster.h" | 30 #include "core/css/resolver/StyleAdjuster.h" |
31 | 31 |
32 #include "HTMLNames.h" | 32 #include "HTMLNames.h" |
33 #include "SVGNames.h" | 33 #include "SVGNames.h" |
34 #include "core/dom/ContainerNode.h" | 34 #include "core/dom/ContainerNode.h" |
35 #include "core/dom/Document.h" | 35 #include "core/dom/Document.h" |
36 #include "core/dom/Element.h" | 36 #include "core/dom/Element.h" |
37 #include "core/dom/NodeRenderStyle.h" | |
38 #include "core/html/HTMLIFrameElement.h" | 37 #include "core/html/HTMLIFrameElement.h" |
39 #include "core/html/HTMLInputElement.h" | 38 #include "core/html/HTMLInputElement.h" |
40 #include "core/html/HTMLTableCellElement.h" | 39 #include "core/html/HTMLTableCellElement.h" |
41 #include "core/html/HTMLTextAreaElement.h" | 40 #include "core/html/HTMLTextAreaElement.h" |
42 #include "core/frame/FrameView.h" | 41 #include "core/frame/FrameView.h" |
43 #include "core/frame/Settings.h" | 42 #include "core/frame/Settings.h" |
44 #include "core/rendering/RenderTheme.h" | 43 #include "core/rendering/RenderTheme.h" |
45 #include "core/rendering/style/GridPosition.h" | 44 #include "core/rendering/style/GridPosition.h" |
46 #include "core/rendering/style/RenderStyle.h" | 45 #include "core/rendering/style/RenderStyle.h" |
47 #include "core/rendering/style/RenderStyleConstants.h" | 46 #include "core/rendering/style/RenderStyleConstants.h" |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 | 309 |
311 // RenderSVGRoot handles zooming for the whole SVG subtree, so foreignOb
ject content should | 310 // RenderSVGRoot handles zooming for the whole SVG subtree, so foreignOb
ject content should |
312 // not be scaled again. | 311 // not be scaled again. |
313 if (isSVGForeignObjectElement(*e)) | 312 if (isSVGForeignObjectElement(*e)) |
314 style->setEffectiveZoom(RenderStyle::initialZoom()); | 313 style->setEffectiveZoom(RenderStyle::initialZoom()); |
315 | 314 |
316 // SVG text layout code expects us to be a block-level style element. | 315 // SVG text layout code expects us to be a block-level style element. |
317 if ((isSVGForeignObjectElement(*e) || isSVGTextElement(*e)) && style->is
DisplayInlineType()) | 316 if ((isSVGForeignObjectElement(*e) || isSVGTextElement(*e)) && style->is
DisplayInlineType()) |
318 style->setDisplay(BLOCK); | 317 style->setDisplay(BLOCK); |
319 } | 318 } |
320 | |
321 if (e && e->renderStyle() && e->renderStyle()->textAutosizingMultiplier() !=
1) { | |
322 // Preserve the text autosizing multiplier on style recalc. | |
323 // (The autosizer will update it during layout if it needs to be changed
.) | |
324 style->setTextAutosizingMultiplier(e->renderStyle()->textAutosizingMulti
plier()); | |
325 style->setUnique(); | |
326 } | |
327 } | 319 } |
328 | 320 |
329 void StyleAdjuster::adjustStyleForTagName(RenderStyle* style, RenderStyle* paren
tStyle, Element& element) | 321 void StyleAdjuster::adjustStyleForTagName(RenderStyle* style, RenderStyle* paren
tStyle, Element& element) |
330 { | 322 { |
331 // <div> and <span> are the most common elements on the web, we skip all the
work for them. | 323 // <div> and <span> are the most common elements on the web, we skip all the
work for them. |
332 if (isHTMLDivElement(element) || isHTMLSpanElement(element)) | 324 if (isHTMLDivElement(element) || isHTMLSpanElement(element)) |
333 return; | 325 return; |
334 | 326 |
335 if (isHTMLTableCellElement(element)) { | 327 if (isHTMLTableCellElement(element)) { |
336 // If we have a <td> that specifies a float property, in quirks mode we
just drop the float property. | 328 // If we have a <td> that specifies a float property, in quirks mode we
just drop the float property. |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 if (style->writingMode() != TopToBottomWritingMode && (style->display() == B
OX || style->display() == INLINE_BOX)) | 440 if (style->writingMode() != TopToBottomWritingMode && (style->display() == B
OX || style->display() == INLINE_BOX)) |
449 style->setWritingMode(TopToBottomWritingMode); | 441 style->setWritingMode(TopToBottomWritingMode); |
450 | 442 |
451 if (isDisplayFlexibleBox(parentStyle->display()) || isDisplayGridBox(parentS
tyle->display())) { | 443 if (isDisplayFlexibleBox(parentStyle->display()) || isDisplayGridBox(parentS
tyle->display())) { |
452 style->setFloating(NoFloat); | 444 style->setFloating(NoFloat); |
453 style->setDisplay(equivalentBlockDisplay(style->display(), style->isFloa
ting(), !m_useQuirksModeStyles)); | 445 style->setDisplay(equivalentBlockDisplay(style->display(), style->isFloa
ting(), !m_useQuirksModeStyles)); |
454 } | 446 } |
455 } | 447 } |
456 | 448 |
457 } | 449 } |
OLD | NEW |