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

Side by Side Diff: Source/core/style/ComputedStyle.h

Issue 1181023004: Move rem handling out of CSSParserValues.cpp (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Another attempt Created 5 years, 4 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
« no previous file with comments | « Source/core/dom/TreeScopeStyleSheetCollection.cpp ('k') | Source/core/style/ComputedStyle.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) 3 * (C) 2000 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 unsigned unique : 1; // Style can not be shared. 273 unsigned unique : 1; // Style can not be shared.
274 274
275 unsigned emptyState : 1; 275 unsigned emptyState : 1;
276 276
277 unsigned affectedByFocus : 1; 277 unsigned affectedByFocus : 1;
278 unsigned affectedByHover : 1; 278 unsigned affectedByHover : 1;
279 unsigned affectedByActive : 1; 279 unsigned affectedByActive : 1;
280 unsigned affectedByDrag : 1; 280 unsigned affectedByDrag : 1;
281 281
282 unsigned isLink : 1; 282 unsigned isLink : 1;
283
284 mutable unsigned hasRemUnits : 1;
283 // If you add more style bits here, you will also need to update Compute dStyle::copyNonInheritedFromCached() 285 // If you add more style bits here, you will also need to update Compute dStyle::copyNonInheritedFromCached()
284 // 62 bits 286 // 63 bits
285 } noninherited_flags; 287 } noninherited_flags;
286 288
287 // !END SYNC! 289 // !END SYNC!
288 290
289 protected: 291 protected:
290 void setBitDefaults() 292 void setBitDefaults()
291 { 293 {
292 inherited_flags._empty_cells = initialEmptyCells(); 294 inherited_flags._empty_cells = initialEmptyCells();
293 inherited_flags._caption_side = initialCaptionSide(); 295 inherited_flags._caption_side = initialCaptionSide();
294 inherited_flags._list_style_type = initialListStyleType(); 296 inherited_flags._list_style_type = initialListStyleType();
(...skipping 29 matching lines...) Expand all
324 noninherited_flags.pseudoBits = 0; 326 noninherited_flags.pseudoBits = 0;
325 noninherited_flags.explicitInheritance = false; 327 noninherited_flags.explicitInheritance = false;
326 noninherited_flags.unique = false; 328 noninherited_flags.unique = false;
327 noninherited_flags.emptyState = false; 329 noninherited_flags.emptyState = false;
328 noninherited_flags.hasViewportUnits = false; 330 noninherited_flags.hasViewportUnits = false;
329 noninherited_flags.affectedByFocus = false; 331 noninherited_flags.affectedByFocus = false;
330 noninherited_flags.affectedByHover = false; 332 noninherited_flags.affectedByHover = false;
331 noninherited_flags.affectedByActive = false; 333 noninherited_flags.affectedByActive = false;
332 noninherited_flags.affectedByDrag = false; 334 noninherited_flags.affectedByDrag = false;
333 noninherited_flags.isLink = false; 335 noninherited_flags.isLink = false;
336 noninherited_flags.hasRemUnits = false;
334 } 337 }
335 338
336 private: 339 private:
337 ALWAYS_INLINE ComputedStyle(); 340 ALWAYS_INLINE ComputedStyle();
338 341
339 enum InitialStyleTag { 342 enum InitialStyleTag {
340 InitialStyle 343 InitialStyle
341 }; 344 };
342 ALWAYS_INLINE explicit ComputedStyle(InitialStyleTag); 345 ALWAYS_INLINE explicit ComputedStyle(InitialStyleTag);
343 ALWAYS_INLINE ComputedStyle(const ComputedStyle&); 346 ALWAYS_INLINE ComputedStyle(const ComputedStyle&);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 378
376 ComputedStyle* getCachedPseudoStyle(PseudoId) const; 379 ComputedStyle* getCachedPseudoStyle(PseudoId) const;
377 ComputedStyle* addCachedPseudoStyle(PassRefPtr<ComputedStyle>); 380 ComputedStyle* addCachedPseudoStyle(PassRefPtr<ComputedStyle>);
378 void removeCachedPseudoStyle(PseudoId); 381 void removeCachedPseudoStyle(PseudoId);
379 382
380 const PseudoStyleCache* cachedPseudoStyles() const { return m_cachedPseudoSt yles.get(); } 383 const PseudoStyleCache* cachedPseudoStyles() const { return m_cachedPseudoSt yles.get(); }
381 384
382 void setHasViewportUnits(bool hasViewportUnits = true) const { noninherited_ flags.hasViewportUnits = hasViewportUnits; } 385 void setHasViewportUnits(bool hasViewportUnits = true) const { noninherited_ flags.hasViewportUnits = hasViewportUnits; }
383 bool hasViewportUnits() const { return noninherited_flags.hasViewportUnits; } 386 bool hasViewportUnits() const { return noninherited_flags.hasViewportUnits; }
384 387
388 void setHasRemUnits() const { noninherited_flags.hasRemUnits = true; }
389 bool hasRemUnits() const { return noninherited_flags.hasRemUnits; }
390
385 bool affectedByFocus() const { return noninherited_flags.affectedByFocus; } 391 bool affectedByFocus() const { return noninherited_flags.affectedByFocus; }
386 bool affectedByHover() const { return noninherited_flags.affectedByHover; } 392 bool affectedByHover() const { return noninherited_flags.affectedByHover; }
387 bool affectedByActive() const { return noninherited_flags.affectedByActive; } 393 bool affectedByActive() const { return noninherited_flags.affectedByActive; }
388 bool affectedByDrag() const { return noninherited_flags.affectedByDrag; } 394 bool affectedByDrag() const { return noninherited_flags.affectedByDrag; }
389 395
390 void setAffectedByFocus() { noninherited_flags.affectedByFocus = true; } 396 void setAffectedByFocus() { noninherited_flags.affectedByFocus = true; }
391 void setAffectedByHover() { noninherited_flags.affectedByHover = true; } 397 void setAffectedByHover() { noninherited_flags.affectedByHover = true; }
392 void setAffectedByActive() { noninherited_flags.affectedByActive = true; } 398 void setAffectedByActive() { noninherited_flags.affectedByActive = true; }
393 void setAffectedByDrag() { noninherited_flags.affectedByDrag = true; } 399 void setAffectedByDrag() { noninherited_flags.affectedByDrag = true; }
394 400
(...skipping 1546 matching lines...) Expand 10 before | Expand all | Expand 10 after
1941 } 1947 }
1942 1948
1943 inline bool ComputedStyle::hasPseudoElementStyle() const 1949 inline bool ComputedStyle::hasPseudoElementStyle() const
1944 { 1950 {
1945 return noninherited_flags.pseudoBits & PSEUDO_ELEMENT_MASK; 1951 return noninherited_flags.pseudoBits & PSEUDO_ELEMENT_MASK;
1946 } 1952 }
1947 1953
1948 } // namespace blink 1954 } // namespace blink
1949 1955
1950 #endif // ComputedStyle_h 1956 #endif // ComputedStyle_h
OLDNEW
« no previous file with comments | « Source/core/dom/TreeScopeStyleSheetCollection.cpp ('k') | Source/core/style/ComputedStyle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698