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: third_party/WebKit/Source/core/style/ComputedStyle.h

Issue 2555923002: Changed TextDirection to an enum class and renamed its members (Closed)
Patch Set: Added 2 changes in mac files Created 4 years 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 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
6 * rights reserved. 6 * rights reserved.
7 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) 7 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 353
354 // !END SYNC! 354 // !END SYNC!
355 355
356 void setBitDefaults() { 356 void setBitDefaults() {
357 ComputedStyleBase::setBitDefaults(); 357 ComputedStyleBase::setBitDefaults();
358 m_inheritedData.m_listStyleType = 358 m_inheritedData.m_listStyleType =
359 static_cast<unsigned>(initialListStyleType()); 359 static_cast<unsigned>(initialListStyleType());
360 m_inheritedData.m_textAlign = static_cast<unsigned>(initialTextAlign()); 360 m_inheritedData.m_textAlign = static_cast<unsigned>(initialTextAlign());
361 m_inheritedData.m_hasSimpleUnderline = false; 361 m_inheritedData.m_hasSimpleUnderline = false;
362 m_inheritedData.m_cursorStyle = static_cast<unsigned>(initialCursor()); 362 m_inheritedData.m_cursorStyle = static_cast<unsigned>(initialCursor());
363 m_inheritedData.m_direction = initialDirection(); 363 m_inheritedData.m_direction = static_cast<unsigned>(initialDirection());
364 m_inheritedData.m_whiteSpace = static_cast<unsigned>(initialWhiteSpace()); 364 m_inheritedData.m_whiteSpace = static_cast<unsigned>(initialWhiteSpace());
365 m_inheritedData.m_rtlOrdering = static_cast<unsigned>(initialRTLOrdering()); 365 m_inheritedData.m_rtlOrdering = static_cast<unsigned>(initialRTLOrdering());
366 m_inheritedData.m_boxDirection = 366 m_inheritedData.m_boxDirection =
367 static_cast<unsigned>(initialBoxDirection()); 367 static_cast<unsigned>(initialBoxDirection());
368 m_inheritedData.m_printColorAdjust = 368 m_inheritedData.m_printColorAdjust =
369 static_cast<unsigned>(initialPrintColorAdjust()); 369 static_cast<unsigned>(initialPrintColorAdjust());
370 m_inheritedData.m_pointerEvents = 370 m_inheritedData.m_pointerEvents =
371 static_cast<unsigned>(initialPointerEvents()); 371 static_cast<unsigned>(initialPointerEvents());
372 m_inheritedData.m_insideLink = NotInsideLink; 372 m_inheritedData.m_insideLink = NotInsideLink;
373 m_inheritedData.m_writingMode = initialWritingMode(); 373 m_inheritedData.m_writingMode = initialWritingMode();
(...skipping 1689 matching lines...) Expand 10 before | Expand all | Expand 10 after
2063 // cursor 2063 // cursor
2064 static ECursor initialCursor() { return ECursor::Auto; } 2064 static ECursor initialCursor() { return ECursor::Auto; }
2065 ECursor cursor() const { 2065 ECursor cursor() const {
2066 return static_cast<ECursor>(m_inheritedData.m_cursorStyle); 2066 return static_cast<ECursor>(m_inheritedData.m_cursorStyle);
2067 } 2067 }
2068 void setCursor(ECursor c) { 2068 void setCursor(ECursor c) {
2069 m_inheritedData.m_cursorStyle = static_cast<unsigned>(c); 2069 m_inheritedData.m_cursorStyle = static_cast<unsigned>(c);
2070 } 2070 }
2071 2071
2072 // direction 2072 // direction
2073 static TextDirection initialDirection() { return LTR; } 2073 static TextDirection initialDirection() { return TextDirection::Ltr; }
2074 TextDirection direction() const { 2074 TextDirection direction() const {
2075 return static_cast<TextDirection>(m_inheritedData.m_direction); 2075 return static_cast<TextDirection>(m_inheritedData.m_direction);
2076 } 2076 }
2077 void setDirection(TextDirection v) { m_inheritedData.m_direction = v; } 2077 void setDirection(TextDirection v) {
2078 m_inheritedData.m_direction = static_cast<unsigned>(v);
2079 }
2078 2080
2079 // color 2081 // color
2080 static Color initialColor() { return Color::black; } 2082 static Color initialColor() { return Color::black; }
2081 void setColor(const Color&); 2083 void setColor(const Color&);
2082 2084
2083 // hyphens 2085 // hyphens
2084 static Hyphens initialHyphens() { return HyphensManual; } 2086 static Hyphens initialHyphens() { return HyphensManual; }
2085 Hyphens getHyphens() const { 2087 Hyphens getHyphens() const {
2086 return static_cast<Hyphens>(m_rareInheritedData->hyphens); 2088 return static_cast<Hyphens>(m_rareInheritedData->hyphens);
2087 } 2089 }
(...skipping 1323 matching lines...) Expand 10 before | Expand all | Expand 10 after
3411 3413
3412 // Mix-blend-mode utility functions. 3414 // Mix-blend-mode utility functions.
3413 bool hasBlendMode() const { return blendMode() != WebBlendModeNormal; } 3415 bool hasBlendMode() const { return blendMode() != WebBlendModeNormal; }
3414 3416
3415 // Motion utility functions. 3417 // Motion utility functions.
3416 bool hasOffset() const { 3418 bool hasOffset() const {
3417 return (offsetPosition().x() != Length(Auto)) || offsetPath(); 3419 return (offsetPosition().x() != Length(Auto)) || offsetPath();
3418 } 3420 }
3419 3421
3420 // Direction utility functions. 3422 // Direction utility functions.
3421 bool isLeftToRightDirection() const { return direction() == LTR; } 3423 bool isLeftToRightDirection() const {
3424 return direction() == TextDirection::Ltr;
3425 }
3422 3426
3423 // Perspective utility functions. 3427 // Perspective utility functions.
3424 bool hasPerspective() const { 3428 bool hasPerspective() const {
3425 return m_rareNonInheritedData->m_perspective > 0; 3429 return m_rareNonInheritedData->m_perspective > 0;
3426 } 3430 }
3427 3431
3428 // Page size utility functions. 3432 // Page size utility functions.
3429 void resetPageSizeType() { 3433 void resetPageSizeType() {
3430 SET_VAR(m_rareNonInheritedData, m_pageSizeType, PAGE_SIZE_AUTO); 3434 SET_VAR(m_rareNonInheritedData, m_pageSizeType, PAGE_SIZE_AUTO);
3431 } 3435 }
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after
4091 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - 1); 4095 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - 1);
4092 } 4096 }
4093 4097
4094 inline bool ComputedStyle::hasPseudoElementStyle() const { 4098 inline bool ComputedStyle::hasPseudoElementStyle() const {
4095 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; 4099 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask;
4096 } 4100 }
4097 4101
4098 } // namespace blink 4102 } // namespace blink
4099 4103
4100 #endif // ComputedStyle_h 4104 #endif // ComputedStyle_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698