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

Side by Side Diff: Source/core/css/resolver/StyleResolverState.cpp

Issue 5216392399814656: Clear StyleResolverState after each resolve. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 5 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 * 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 16 matching lines...) Expand all
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 void StyleResolverState::clear() 34 void StyleResolverState::clear()
35 { 35 {
36 m_element = 0; 36 m_element = 0;
37 m_style = 0;
37 m_styledElement = 0; 38 m_styledElement = 0;
38 m_parentStyle = 0; 39 m_parentStyle = 0;
39 m_parentNode = 0; 40 m_parentNode = 0;
40 m_regionForStyling = 0; 41 m_regionForStyling = 0;
41 m_elementStyleResources.clear(); 42 m_elementStyleResources.clear();
42 } 43 }
43 44
45 PassRefPtr<RenderStyle> StyleResolverState::takeStyleAndClear()
46 {
47 RefPtr<RenderStyle> result = takeStyle();
48 clear();
49 return result.release();
50 }
51
44 void StyleResolverState::initElement(Element* element) 52 void StyleResolverState::initElement(Element* element)
45 { 53 {
46 if (m_element == element) 54 if (m_element == element)
47 return; 55 return;
48 56
49 m_element = element; 57 m_element = element;
50 m_styledElement = element && element->isStyledElement() ? element : 0; 58 m_styledElement = element && element->isStyledElement() ? element : 0;
51 m_elementLinkState = element ? element->document()->visitedLinkState()->dete rmineLinkState(element) : NotInsideLink; 59 m_elementLinkState = element ? element->document()->visitedLinkState()->dete rmineLinkState(element) : NotInsideLink;
52 60
53 if (!element || element != element->document()->documentElement()) 61 if (!element || element != element->document()->documentElement())
(...skipping 28 matching lines...) Expand all
82 90
83 m_style = 0; 91 m_style = 0;
84 m_elementStyleResources.clear(); 92 m_elementStyleResources.clear();
85 m_fontDirty = false; 93 m_fontDirty = false;
86 94
87 if (Page* page = document->page()) 95 if (Page* page = document->page())
88 m_elementStyleResources.setDeviceScaleFactor(page->deviceScaleFactor()); 96 m_elementStyleResources.setDeviceScaleFactor(page->deviceScaleFactor());
89 } 97 }
90 98
91 } // namespace WebCore 99 } // namespace WebCore
OLDNEW
« Source/core/css/resolver/StyleResolver.cpp ('K') | « Source/core/css/resolver/StyleResolverState.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698