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

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: Add test 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
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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 377
376 ComputedStyle* getCachedPseudoStyle(PseudoId) const; 378 ComputedStyle* getCachedPseudoStyle(PseudoId) const;
377 ComputedStyle* addCachedPseudoStyle(PassRefPtr<ComputedStyle>); 379 ComputedStyle* addCachedPseudoStyle(PassRefPtr<ComputedStyle>);
378 void removeCachedPseudoStyle(PseudoId); 380 void removeCachedPseudoStyle(PseudoId);
379 381
380 const PseudoStyleCache* cachedPseudoStyles() const { return m_cachedPseudoSt yles.get(); } 382 const PseudoStyleCache* cachedPseudoStyles() const { return m_cachedPseudoSt yles.get(); }
381 383
382 void setHasViewportUnits(bool hasViewportUnits = true) const { noninherited_ flags.hasViewportUnits = hasViewportUnits; } 384 void setHasViewportUnits(bool hasViewportUnits = true) const { noninherited_ flags.hasViewportUnits = hasViewportUnits; }
383 bool hasViewportUnits() const { return noninherited_flags.hasViewportUnits; } 385 bool hasViewportUnits() const { return noninherited_flags.hasViewportUnits; }
384 386
387 void setHasRemUnits(bool hasRemUnits = true) const { noninherited_flags.hasR emUnits = hasRemUnits; }
Timothy Loh 2015/07/30 01:06:55 Probably no point having an argument (even though
388 bool hasRemUnits() const { return noninherited_flags.hasRemUnits; }
389
385 bool affectedByFocus() const { return noninherited_flags.affectedByFocus; } 390 bool affectedByFocus() const { return noninherited_flags.affectedByFocus; }
386 bool affectedByHover() const { return noninherited_flags.affectedByHover; } 391 bool affectedByHover() const { return noninherited_flags.affectedByHover; }
387 bool affectedByActive() const { return noninherited_flags.affectedByActive; } 392 bool affectedByActive() const { return noninherited_flags.affectedByActive; }
388 bool affectedByDrag() const { return noninherited_flags.affectedByDrag; } 393 bool affectedByDrag() const { return noninherited_flags.affectedByDrag; }
389 394
390 void setAffectedByFocus() { noninherited_flags.affectedByFocus = true; } 395 void setAffectedByFocus() { noninherited_flags.affectedByFocus = true; }
391 void setAffectedByHover() { noninherited_flags.affectedByHover = true; } 396 void setAffectedByHover() { noninherited_flags.affectedByHover = true; }
392 void setAffectedByActive() { noninherited_flags.affectedByActive = true; } 397 void setAffectedByActive() { noninherited_flags.affectedByActive = true; }
393 void setAffectedByDrag() { noninherited_flags.affectedByDrag = true; } 398 void setAffectedByDrag() { noninherited_flags.affectedByDrag = true; }
394 399
(...skipping 1546 matching lines...) Expand 10 before | Expand all | Expand 10 after
1941 } 1946 }
1942 1947
1943 inline bool ComputedStyle::hasPseudoElementStyle() const 1948 inline bool ComputedStyle::hasPseudoElementStyle() const
1944 { 1949 {
1945 return noninherited_flags.pseudoBits & PSEUDO_ELEMENT_MASK; 1950 return noninherited_flags.pseudoBits & PSEUDO_ELEMENT_MASK;
1946 } 1951 }
1947 1952
1948 } // namespace blink 1953 } // namespace blink
1949 1954
1950 #endif // ComputedStyle_h 1955 #endif // ComputedStyle_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698