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

Side by Side Diff: Source/core/rendering/style/StyleRareNonInheritedData.cpp

Issue 18371008: Add a WebDocument::watchCssSelectors(selectors) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@pinned
Patch Set: Fix most comments; TODO benchmark and use Element::recalcStyle 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 Antti Koivisto (koivisto@kde.org) 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 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,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details. 13 * Library General Public License for more details.
14 * 14 *
15 * You should have received a copy of the GNU Library General Public License 15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to 16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA. 18 * Boston, MA 02110-1301, USA.
19 * 19 *
20 */ 20 */
21 21
22 #include "config.h" 22 #include "config.h"
23 #include "core/rendering/style/StyleRareNonInheritedData.h" 23 #include "core/rendering/style/StyleRareNonInheritedData.h"
24 24
25 #include "core/dom/CSSSelectorWatch.h"
25 #include "core/dom/WebCoreMemoryInstrumentation.h" 26 #include "core/dom/WebCoreMemoryInstrumentation.h"
26 #include "core/rendering/style/ContentData.h" 27 #include "core/rendering/style/ContentData.h"
27 #include "core/rendering/style/RenderStyle.h" 28 #include "core/rendering/style/RenderStyle.h"
28 #include "core/rendering/style/ShadowData.h" 29 #include "core/rendering/style/ShadowData.h"
29 #include "core/rendering/style/StyleFilterData.h" 30 #include "core/rendering/style/StyleFilterData.h"
30 #include "core/rendering/style/StyleTransformData.h" 31 #include "core/rendering/style/StyleTransformData.h"
31 #include <wtf/MemoryInstrumentationHashMap.h> 32 #include <wtf/MemoryInstrumentationHashMap.h>
32 #include <wtf/MemoryInstrumentationVector.h> 33 #include <wtf/MemoryInstrumentationVector.h>
33 #include <wtf/MemoryObjectInfo.h> 34 #include <wtf/MemoryObjectInfo.h>
34 35
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 , m_wrapThrough(o.m_wrapThrough) 150 , m_wrapThrough(o.m_wrapThrough)
150 , m_runningAcceleratedAnimation(o.m_runningAcceleratedAnimation) 151 , m_runningAcceleratedAnimation(o.m_runningAcceleratedAnimation)
151 , m_hasAspectRatio(o.m_hasAspectRatio) 152 , m_hasAspectRatio(o.m_hasAspectRatio)
152 , m_effectiveBlendMode(o.m_effectiveBlendMode) 153 , m_effectiveBlendMode(o.m_effectiveBlendMode)
153 , m_touchAction(o.m_touchAction) 154 , m_touchAction(o.m_touchAction)
154 { 155 {
155 } 156 }
156 157
157 StyleRareNonInheritedData::~StyleRareNonInheritedData() 158 StyleRareNonInheritedData::~StyleRareNonInheritedData()
158 { 159 {
160 if (!m_callbackSelectors.isEmpty() && m_selectorWatch.get()) {
161 for (Vector<String>::const_iterator it = m_callbackSelectors.begin(), en d = m_callbackSelectors.end();
162 it != end; ++it)
163 m_selectorWatch.get()->removeSelectorMatch(*it);
164 }
159 } 165 }
160 166
161 bool StyleRareNonInheritedData::operator==(const StyleRareNonInheritedData& o) c onst 167 bool StyleRareNonInheritedData::operator==(const StyleRareNonInheritedData& o) c onst
162 { 168 {
163 return opacity == o.opacity 169 return opacity == o.opacity
164 && m_aspectRatioDenominator == o.m_aspectRatioDenominator 170 && m_aspectRatioDenominator == o.m_aspectRatioDenominator
165 && m_aspectRatioNumerator == o.m_aspectRatioNumerator 171 && m_aspectRatioNumerator == o.m_aspectRatioNumerator
166 && m_perspective == o.m_perspective 172 && m_perspective == o.m_perspective
167 && m_perspectiveOriginX == o.m_perspectiveOriginX 173 && m_perspectiveOriginX == o.m_perspectiveOriginX
168 && m_perspectiveOriginY == o.m_perspectiveOriginY 174 && m_perspectiveOriginY == o.m_perspectiveOriginY
(...skipping 23 matching lines...) Expand all
192 && m_clipPath == o.m_clipPath 198 && m_clipPath == o.m_clipPath
193 && m_textDecorationColor == o.m_textDecorationColor 199 && m_textDecorationColor == o.m_textDecorationColor
194 && m_visitedLinkTextDecorationColor == o.m_visitedLinkTextDecorationColo r 200 && m_visitedLinkTextDecorationColor == o.m_visitedLinkTextDecorationColo r
195 && m_visitedLinkBackgroundColor == o.m_visitedLinkBackgroundColor 201 && m_visitedLinkBackgroundColor == o.m_visitedLinkBackgroundColor
196 && m_visitedLinkOutlineColor == o.m_visitedLinkOutlineColor 202 && m_visitedLinkOutlineColor == o.m_visitedLinkOutlineColor
197 && m_visitedLinkBorderLeftColor == o.m_visitedLinkBorderLeftColor 203 && m_visitedLinkBorderLeftColor == o.m_visitedLinkBorderLeftColor
198 && m_visitedLinkBorderRightColor == o.m_visitedLinkBorderRightColor 204 && m_visitedLinkBorderRightColor == o.m_visitedLinkBorderRightColor
199 && m_visitedLinkBorderTopColor == o.m_visitedLinkBorderTopColor 205 && m_visitedLinkBorderTopColor == o.m_visitedLinkBorderTopColor
200 && m_visitedLinkBorderBottomColor == o.m_visitedLinkBorderBottomColor 206 && m_visitedLinkBorderBottomColor == o.m_visitedLinkBorderBottomColor
201 && m_order == o.m_order 207 && m_order == o.m_order
208 && m_callbackSelectors == o.m_callbackSelectors
209 && m_selectorWatch.get() == o.m_selectorWatch.get()
202 && m_flowThread == o.m_flowThread 210 && m_flowThread == o.m_flowThread
203 && m_regionThread == o.m_regionThread 211 && m_regionThread == o.m_regionThread
204 && m_regionFragment == o.m_regionFragment 212 && m_regionFragment == o.m_regionFragment
205 && m_regionBreakAfter == o.m_regionBreakAfter 213 && m_regionBreakAfter == o.m_regionBreakAfter
206 && m_regionBreakBefore == o.m_regionBreakBefore 214 && m_regionBreakBefore == o.m_regionBreakBefore
207 && m_regionBreakInside == o.m_regionBreakInside 215 && m_regionBreakInside == o.m_regionBreakInside
208 && m_pageSizeType == o.m_pageSizeType 216 && m_pageSizeType == o.m_pageSizeType
209 && m_transformStyle3D == o.m_transformStyle3D 217 && m_transformStyle3D == o.m_transformStyle3D
210 && m_backfaceVisibility == o.m_backfaceVisibility 218 && m_backfaceVisibility == o.m_backfaceVisibility
211 && m_alignContent == o.m_alignContent 219 && m_alignContent == o.m_alignContent
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 info.addMember(m_regionThread, "regionThread"); 321 info.addMember(m_regionThread, "regionThread");
314 322
315 info.ignoreMember(m_perspectiveOriginX); 323 info.ignoreMember(m_perspectiveOriginX);
316 info.ignoreMember(m_perspectiveOriginY); 324 info.ignoreMember(m_perspectiveOriginY);
317 info.ignoreMember(m_pageSize); 325 info.ignoreMember(m_pageSize);
318 info.ignoreMember(m_shapeMargin); 326 info.ignoreMember(m_shapeMargin);
319 info.ignoreMember(m_shapePadding); 327 info.ignoreMember(m_shapePadding);
320 } 328 }
321 329
322 } // namespace WebCore 330 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698