OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. | 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 13 matching lines...) Expand all Loading... |
24 | 24 |
25 #include "core/dom/Element.h" | 25 #include "core/dom/Element.h" |
26 #include "core/dom/Node.h" | 26 #include "core/dom/Node.h" |
27 #include "core/dom/NodeRenderStyle.h" | 27 #include "core/dom/NodeRenderStyle.h" |
28 #include "core/dom/NodeRenderingContext.h" | 28 #include "core/dom/NodeRenderingContext.h" |
29 #include "core/dom/VisitedLinkState.h" | 29 #include "core/dom/VisitedLinkState.h" |
30 #include "core/page/Page.h" | 30 #include "core/page/Page.h" |
31 | 31 |
32 namespace WebCore { | 32 namespace WebCore { |
33 | 33 |
| 34 StyleResolverState::ScopedStyleResolution::ScopedStyleResolution(StyleResolverSt
ate* state, Document* document, Element* e, int childIndex, RenderStyle* parentS
tyle, RenderRegion* regionForStyling) |
| 35 : m_state(state) |
| 36 { |
| 37 m_state->initForStyleResolve(document, e, childIndex, parentStyle, regionFor
Styling); |
| 38 } |
| 39 |
| 40 StyleResolverState::ScopedStyleResolution::~ScopedStyleResolution() |
| 41 { |
| 42 m_state->clear(); |
| 43 } |
| 44 |
34 void StyleResolverState::clear() | 45 void StyleResolverState::clear() |
35 { | 46 { |
36 m_element = 0; | 47 m_element = 0; |
37 m_childIndex = 0; | 48 m_childIndex = 0; |
| 49 m_style = 0; |
38 m_styledElement = 0; | 50 m_styledElement = 0; |
39 m_parentStyle = 0; | 51 m_parentStyle = 0; |
40 m_parentNode = 0; | 52 m_parentNode = 0; |
41 m_regionForStyling = 0; | 53 m_regionForStyling = 0; |
42 m_elementStyleResources.clear(); | 54 m_elementStyleResources.clear(); |
43 } | 55 } |
44 | 56 |
45 void StyleResolverState::initElement(Element* element, int childIndex) | 57 void StyleResolverState::initElement(Element* element, int childIndex) |
46 { | 58 { |
47 if (m_element == element) | 59 if (m_element == element) |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 | 95 |
84 m_style = 0; | 96 m_style = 0; |
85 m_elementStyleResources.clear(); | 97 m_elementStyleResources.clear(); |
86 m_fontDirty = false; | 98 m_fontDirty = false; |
87 | 99 |
88 if (Page* page = document->page()) | 100 if (Page* page = document->page()) |
89 m_elementStyleResources.setDeviceScaleFactor(page->deviceScaleFactor()); | 101 m_elementStyleResources.setDeviceScaleFactor(page->deviceScaleFactor()); |
90 } | 102 } |
91 | 103 |
92 } // namespace WebCore | 104 } // namespace WebCore |
OLD | NEW |