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

Unified Diff: Source/core/rendering/InlineIterator.h

Issue 24055009: Isolate elements are treated as neutral in UBA however Blink UBA implementation iterates over all t… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Proposed patch v3 Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/platform/text/BidiResolver.h ('k') | Source/core/rendering/RenderBlockLineLayout.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/InlineIterator.h
diff --git a/Source/core/rendering/InlineIterator.h b/Source/core/rendering/InlineIterator.h
index f277912c49841ac8d83d3a105a1881bb9af6d77e..fa5a8ad7431b0b0bc52438653fbe05051339316a 100644
--- a/Source/core/rendering/InlineIterator.h
+++ b/Source/core/rendering/InlineIterator.h
@@ -36,7 +36,7 @@ namespace WebCore {
class InlineIterator {
public:
enum IncrementRule {
- FastIncrementInlineRenderer,
+ FastIncrementInIsolatedRenderer,
FastIncrementInTextNode
};
@@ -361,7 +361,13 @@ inline void InlineIterator::increment(InlineBidiResolver* resolver, IncrementRul
{
if (!m_obj)
return;
- if (m_obj->isText() && rule == FastIncrementInTextNode) {
+
+ if (resolver && resolver->inIsolate() && rule == FastIncrementInIsolatedRenderer) {
+ moveTo(bidiNextSkippingEmptyInlines(m_root, m_obj, resolver), 0);
+ return;
+ }
+
+ if (m_obj->isText()) {
fastIncrementInTextNode();
if (m_pos < toRenderText(m_obj)->textLength())
return;
@@ -410,7 +416,19 @@ ALWAYS_INLINE WTF::Unicode::Direction InlineIterator::direction() const
template<>
inline void InlineBidiResolver::increment()
{
- m_current.increment(this);
+ m_current.increment(this, InlineIterator::FastIncrementInIsolatedRenderer);
+}
+
+template <>
+inline bool InlineBidiResolver::isEndOfParagraph(const InlineIterator& end)
+{
+ bool inEndOfParagraph = m_current == end || m_current.atEnd() || (inIsolate() && m_current.m_obj == end.m_obj);
+ if (inIsolate() && inEndOfParagraph) {
+ m_current.moveTo(m_current.m_obj, end.m_pos, m_current.m_nextBreakablePosition);
+ m_last = m_current;
+ updateStatusLastFromCurrentDirection(WTF::Unicode::OtherNeutral);
+ }
+ return inEndOfParagraph;
}
static inline bool isIsolatedInline(RenderObject* object)
« no previous file with comments | « Source/core/platform/text/BidiResolver.h ('k') | Source/core/rendering/RenderBlockLineLayout.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698