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

Side by Side Diff: third_party/WebKit/Source/core/layout/line/InlineIterator.h

Issue 2555923002: Changed TextDirection to an enum class and renamed its members (Closed)
Patch Set: Rebase after reopen Created 3 years, 12 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 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010 Apple Inc. 3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010 Apple Inc.
4 * All right reserved. 4 * All right reserved.
5 * Copyright (C) 2010 Google Inc. All rights reserved. 5 * Copyright (C) 2010 Google Inc. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 139
140 inline bool operator!=(const InlineIterator& it1, const InlineIterator& it2) { 140 inline bool operator!=(const InlineIterator& it1, const InlineIterator& it2) {
141 return it1.offset() != it2.offset() || 141 return it1.offset() != it2.offset() ||
142 it1.getLineLayoutItem() != it2.getLineLayoutItem(); 142 it1.getLineLayoutItem() != it2.getLineLayoutItem();
143 } 143 }
144 144
145 static inline WTF::Unicode::CharDirection embedCharFromDirection( 145 static inline WTF::Unicode::CharDirection embedCharFromDirection(
146 TextDirection dir, 146 TextDirection dir,
147 EUnicodeBidi unicodeBidi) { 147 EUnicodeBidi unicodeBidi) {
148 using namespace WTF::Unicode; 148 using namespace WTF::Unicode;
149 if (unicodeBidi == Embed) 149 if (unicodeBidi == Embed) {
150 return dir == RTL ? RightToLeftEmbedding : LeftToRightEmbedding; 150 return dir == TextDirection::Rtl ? RightToLeftEmbedding
151 return dir == RTL ? RightToLeftOverride : LeftToRightOverride; 151 : LeftToRightEmbedding;
152 }
153 return dir == TextDirection::Rtl ? RightToLeftOverride : LeftToRightOverride;
152 } 154 }
153 155
154 static inline bool treatAsIsolated(const ComputedStyle& style) { 156 static inline bool treatAsIsolated(const ComputedStyle& style) {
155 return isIsolated(style.unicodeBidi()) && 157 return isIsolated(style.unicodeBidi()) &&
156 style.rtlOrdering() == EOrder::Logical; 158 style.rtlOrdering() == EOrder::Logical;
157 } 159 }
158 160
159 template <class Observer> 161 template <class Observer>
160 static inline void notifyObserverEnteredObject(Observer* observer, 162 static inline void notifyObserverEnteredObject(Observer* observer,
161 LineLayoutItem object) { 163 LineLayoutItem object) {
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 BidiRunList<BidiRun>& runs, 588 BidiRunList<BidiRun>& runs,
587 int start, 589 int start,
588 int stop, 590 int stop,
589 BidiRun* run, 591 BidiRun* run,
590 BidiContext* context, 592 BidiContext* context,
591 TextDirection direction) const { 593 TextDirection direction) const {
592 DCHECK(context); 594 DCHECK(context);
593 BidiRun* newTrailingRun = new BidiRun( 595 BidiRun* newTrailingRun = new BidiRun(
594 context->override(), context->level(), start, stop, run->m_lineLayoutItem, 596 context->override(), context->level(), start, stop, run->m_lineLayoutItem,
595 WTF::Unicode::OtherNeutral, context->dir()); 597 WTF::Unicode::OtherNeutral, context->dir());
596 if (direction == LTR) 598 if (direction == TextDirection::Ltr)
597 runs.addRun(newTrailingRun); 599 runs.addRun(newTrailingRun);
598 else 600 else
599 runs.prependRun(newTrailingRun); 601 runs.prependRun(newTrailingRun);
600 602
601 return newTrailingRun; 603 return newTrailingRun;
602 } 604 }
603 605
604 template <> 606 template <>
605 inline bool InlineBidiResolver::needsToApplyL1Rule(BidiRunList<BidiRun>& runs) { 607 inline bool InlineBidiResolver::needsToApplyL1Rule(BidiRunList<BidiRun>& runs) {
606 if (!runs.logicallyLastRun() 608 if (!runs.logicallyLastRun()
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
893 m_sor = m_eor; 895 m_sor = m_eor;
894 } 896 }
895 897
896 m_direction = WTF::Unicode::OtherNeutral; 898 m_direction = WTF::Unicode::OtherNeutral;
897 m_status.eor = WTF::Unicode::OtherNeutral; 899 m_status.eor = WTF::Unicode::OtherNeutral;
898 } 900 }
899 901
900 } // namespace blink 902 } // namespace blink
901 903
902 #endif // InlineIterator_h 904 #endif // InlineIterator_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/line/InlineBox.h ('k') | third_party/WebKit/Source/core/layout/line/InlineTextBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698