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

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

Issue 1463893002: Ignore unicode-bidi: isolate for visual order elements (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Renamed to treatAsIsolated() Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/layout/BidiRunForLine.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/line/InlineIterator.h
diff --git a/third_party/WebKit/Source/core/layout/line/InlineIterator.h b/third_party/WebKit/Source/core/layout/line/InlineIterator.h
index 07108abaf65100eddf81d77fcd2ecdd46d54b50a..03638645df7d5c6e94f60f7b3c8149665c72e039 100644
--- a/third_party/WebKit/Source/core/layout/line/InlineIterator.h
+++ b/third_party/WebKit/Source/core/layout/line/InlineIterator.h
@@ -130,6 +130,11 @@ static inline WTF::Unicode::Direction embedCharFromDirection(TextDirection dir,
return dir == RTL ? RightToLeftOverride : LeftToRightOverride;
}
+static inline bool treatAsIsolated(const ComputedStyle& style)
+{
+ return isIsolated(style.unicodeBidi()) && style.rtlOrdering() == LogicalOrder;
+}
+
template <class Observer>
static inline void notifyObserverEnteredObject(Observer* observer, LineLayoutItem object)
{
@@ -144,7 +149,7 @@ static inline void notifyObserverEnteredObject(Observer* observer, LineLayoutIte
// Thus we ignore any possible dir= attribute on the span.
return;
}
- if (isIsolated(unicodeBidi)) {
+ if (treatAsIsolated(style)) {
// Make sure that explicit embeddings are committed before we enter the isolated content.
observer->commitExplicitEmbedding(observer->runs());
observer->enterIsolate();
@@ -166,7 +171,7 @@ static inline void notifyObserverWillExitObject(Observer* observer, LineLayoutIt
EUnicodeBidi unicodeBidi = object.style()->unicodeBidi();
if (unicodeBidi == UBNormal)
return; // Nothing to do for unicode-bidi: normal
- if (isIsolated(unicodeBidi)) {
+ if (treatAsIsolated(object.styleRef())) {
observer->exitIsolate();
return;
}
@@ -380,7 +385,7 @@ private:
static inline bool endOfLineHasIsolatedObjectAncestor(const InlineIterator& isolatedIterator, const InlineIterator& ancestorItertor)
{
- if (!isolatedIterator.object() || !isIsolated(isolatedIterator.object().style()->unicodeBidi()))
+ if (!isolatedIterator.object() || !treatAsIsolated(isolatedIterator.object().styleRef()))
return false;
LineLayoutItem innerIsolatedObject = isolatedIterator.object();
@@ -532,7 +537,7 @@ inline bool InlineBidiResolver::needsToApplyL1Rule(BidiRunList<BidiRun>& runs)
static inline bool isIsolatedInline(LineLayoutItem object)
{
ASSERT(object);
- return object.isLayoutInline() && isIsolated(object.style()->unicodeBidi());
+ return object.isLayoutInline() && treatAsIsolated(object.styleRef());
}
static inline LineLayoutItem highestContainingIsolateWithinRoot(LineLayoutItem object, LineLayoutItem root)
« no previous file with comments | « third_party/WebKit/Source/core/layout/BidiRunForLine.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698