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

Side by Side Diff: Source/core/rendering/InlineIterator.h

Issue 103823005: Isolated elements at end of line are not being correctly treated (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 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 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010 Apple Inc. All right r eserved. 3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010 Apple Inc. All right r eserved.
4 * Copyright (C) 2010 Google Inc. All rights reserved. 4 * Copyright (C) 2010 Google Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 // FIXME: Support SkipEmptyInlines and observer parameters. 352 // FIXME: Support SkipEmptyInlines and observer parameters.
353 m_current = bidiNextIncludingEmptyInlines(m_root, m_current, &m_atEndOfI nline); 353 m_current = bidiNextIncludingEmptyInlines(m_root, m_current, &m_atEndOfI nline);
354 return m_current; 354 return m_current;
355 } 355 }
356 private: 356 private:
357 RenderObject* m_root; 357 RenderObject* m_root;
358 RenderObject* m_current; 358 RenderObject* m_current;
359 bool m_atEndOfInline; 359 bool m_atEndOfInline;
360 }; 360 };
361 361
362 static inline bool endOfLineHasIsolatedObjectAncestor(const InlineIterator& isol atedIterator, const InlineIterator& ancestorItertor)
363 {
364 if (!isolatedIterator.object() || !isIsolated(isolatedIterator.object()->sty le()->unicodeBidi()))
365 return false;
366
367 RenderObject* innerIsolatedObject = isolatedIterator.object();
368 while (innerIsolatedObject && innerIsolatedObject != isolatedIterator.root() ) {
369 if (innerIsolatedObject == ancestorItertor.object())
370 return true;
371 innerIsolatedObject = innerIsolatedObject->parent();
372 }
373 return false;
374 }
375
362 inline void InlineIterator::increment(InlineBidiResolver* resolver, IncrementRul e rule) 376 inline void InlineIterator::increment(InlineBidiResolver* resolver, IncrementRul e rule)
363 { 377 {
364 if (!m_obj) 378 if (!m_obj)
365 return; 379 return;
366 380
367 if (resolver && resolver->inIsolate() && rule == FastIncrementInIsolatedRend erer) { 381 if (rule == FastIncrementInIsolatedRenderer
382 && resolver && resolver->inIsolate()
383 && !endOfLineHasIsolatedObjectAncestor(resolver->endOfLine(), resolver-> position())) {
368 moveTo(bidiNextSkippingEmptyInlines(m_root, m_obj, resolver), 0); 384 moveTo(bidiNextSkippingEmptyInlines(m_root, m_obj, resolver), 0);
369 return; 385 return;
370 } 386 }
371 387
372 if (m_obj->isText()) { 388 if (m_obj->isText()) {
373 fastIncrementInTextNode(); 389 fastIncrementInTextNode();
374 if (m_pos < toRenderText(m_obj)->textLength()) 390 if (m_pos < toRenderText(m_obj)->textLength())
375 return; 391 return;
376 } 392 }
377 // bidiNext can return 0, so use moveTo instead of moveToStartOf 393 // bidiNext can return 0, so use moveTo instead of moveToStartOf
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 m_sor = m_eor; 651 m_sor = m_eor;
636 } 652 }
637 653
638 m_direction = WTF::Unicode::OtherNeutral; 654 m_direction = WTF::Unicode::OtherNeutral;
639 m_status.eor = WTF::Unicode::OtherNeutral; 655 m_status.eor = WTF::Unicode::OtherNeutral;
640 } 656 }
641 657
642 } 658 }
643 659
644 #endif // InlineIterator_h 660 #endif // InlineIterator_h
OLDNEW
« no previous file with comments | « LayoutTests/fast/text/output-isolate-at-end-of-line-crash-expected.txt ('k') | Source/platform/text/BidiResolver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698