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

Side by Side Diff: Source/core/rendering/RenderBlockLineLayout.cpp

Issue 26315003: Bidi-Isolate inlines break layout with collapsed whitespace (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 2 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, 2011 Apple Inc. All r ight reserved. 3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ight reserved.
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 1285 matching lines...) Expand 10 before | Expand all | Expand 10 after
1296 1296
1297 // Only inlines make sense with unicode-bidi: isolate (blocks are alread y isolated). 1297 // Only inlines make sense with unicode-bidi: isolate (blocks are alread y isolated).
1298 // FIXME: Because enterIsolate is not passed a RenderObject, we have to crawl up the 1298 // FIXME: Because enterIsolate is not passed a RenderObject, we have to crawl up the
1299 // tree to see which parent inline is the isolate. We could change enter Isolate 1299 // tree to see which parent inline is the isolate. We could change enter Isolate
1300 // to take a RenderObject and do this logic there, but that would be a l ayering 1300 // to take a RenderObject and do this logic there, but that would be a l ayering
1301 // violation for BidiResolver (which knows nothing about RenderObject). 1301 // violation for BidiResolver (which knows nothing about RenderObject).
1302 RenderInline* isolatedInline = toRenderInline(highestContainingIsolateWi thinRoot(startObj, currentRoot)); 1302 RenderInline* isolatedInline = toRenderInline(highestContainingIsolateWi thinRoot(startObj, currentRoot));
1303 ASSERT(isolatedInline); 1303 ASSERT(isolatedInline);
1304 1304
1305 InlineBidiResolver isolatedResolver; 1305 InlineBidiResolver isolatedResolver;
1306 LineMidpointState& isolatedLineMidpointState = isolatedResolver.midpoint State();
1307 isolatedLineMidpointState = topResolver.midpointStateForIsolatedRun(isol atedRun);
1306 EUnicodeBidi unicodeBidi = isolatedInline->style()->unicodeBidi(); 1308 EUnicodeBidi unicodeBidi = isolatedInline->style()->unicodeBidi();
1307 TextDirection direction = isolatedInline->style()->direction(); 1309 TextDirection direction = isolatedInline->style()->direction();
1308 if (unicodeBidi == Plaintext) { 1310 if (unicodeBidi == Plaintext) {
1309 if (isNewUBAParagraph) 1311 if (isNewUBAParagraph)
1310 direction = determinePlaintextDirectionality(isolatedInline, sta rtObj); 1312 direction = determinePlaintextDirectionality(isolatedInline, sta rtObj);
1311 else 1313 else
1312 direction = determinePlaintextDirectionality(isolatedInline); 1314 direction = determinePlaintextDirectionality(isolatedInline);
1313 } else { 1315 } else {
1314 ASSERT(unicodeBidi == Isolate || unicodeBidi == IsolateOverride); 1316 ASSERT(unicodeBidi == Isolate || unicodeBidi == IsolateOverride);
1315 direction = isolatedInline->style()->direction(); 1317 direction = isolatedInline->style()->direction();
(...skipping 16 matching lines...) Expand all
1332 // We're not guaranteed to get any BidiRuns in the previous step. If we don't, we allow the placeholder 1334 // We're not guaranteed to get any BidiRuns in the previous step. If we don't, we allow the placeholder
1333 // itself to be turned into an InlineBox. We can't remove it here withou t potentially losing track of 1335 // itself to be turned into an InlineBox. We can't remove it here withou t potentially losing track of
1334 // the logically last run. 1336 // the logically last run.
1335 if (isolatedResolver.runs().runCount()) 1337 if (isolatedResolver.runs().runCount())
1336 bidiRuns.replaceRunWithRuns(isolatedRun, isolatedResolver.runs()); 1338 bidiRuns.replaceRunWithRuns(isolatedRun, isolatedResolver.runs());
1337 1339
1338 // If we encountered any nested isolate runs, just move them 1340 // If we encountered any nested isolate runs, just move them
1339 // to the top resolver's list for later processing. 1341 // to the top resolver's list for later processing.
1340 if (!isolatedResolver.isolatedRuns().isEmpty()) { 1342 if (!isolatedResolver.isolatedRuns().isEmpty()) {
1341 topResolver.isolatedRuns().append(isolatedResolver.isolatedRuns()); 1343 topResolver.isolatedRuns().append(isolatedResolver.isolatedRuns());
1342 isolatedResolver.isolatedRuns().clear();
1343 currentRoot = isolatedInline; 1344 currentRoot = isolatedInline;
1345 while (!isolatedResolver.isolatedRuns().isEmpty()) {
leviw_travelin_and_unemployed 2013/10/07 21:58:42 It's weird to have nested while loops with the sam
1346 BidiRun* run = isolatedResolver.isolatedRuns().last();
1347 isolatedResolver.isolatedRuns().removeLast();
1348 topResolver.setMidpointStateForIsolatedRun(run, isolatedResolver .midpointStateForIsolatedRun(run));
1349 }
1344 } 1350 }
1345 } 1351 }
1346 } 1352 }
1347 1353
1348 static inline bool segmentIsEmpty(const InlineIterator& segmentStart, const Inli neIterator& segmentEnd) 1354 static inline bool segmentIsEmpty(const InlineIterator& segmentStart, const Inli neIterator& segmentEnd)
1349 { 1355 {
1350 return segmentStart == segmentEnd; 1356 return segmentStart == segmentEnd;
1351 } 1357 }
1352 1358
1353 static inline void constructBidiRunsForLine(const RenderBlock* block, InlineBidi Resolver& topResolver, BidiRunList<BidiRun>& bidiRuns, const InlineIterator& end OfLine, VisualDirectionOverride override, bool previousLineBrokeCleanly, bool is NewUBAParagraph) 1359 static inline void constructBidiRunsForLine(const RenderBlock* block, InlineBidi Resolver& topResolver, BidiRunList<BidiRun>& bidiRuns, const InlineIterator& end OfLine, VisualDirectionOverride override, bool previousLineBrokeCleanly, bool is NewUBAParagraph)
(...skipping 2154 matching lines...) Expand 10 before | Expand all | Expand 10 after
3508 lineGridBox->alignBoxesInBlockDirection(logicalHeight(), textBoxDataMap, ver ticalPositionCache); 3514 lineGridBox->alignBoxesInBlockDirection(logicalHeight(), textBoxDataMap, ver ticalPositionCache);
3509 3515
3510 setLineGridBox(lineGridBox); 3516 setLineGridBox(lineGridBox);
3511 3517
3512 // FIXME: If any of the characteristics of the box change compared to the ol d one, then we need to do a deep dirtying 3518 // FIXME: If any of the characteristics of the box change compared to the ol d one, then we need to do a deep dirtying
3513 // (similar to what happens when the page height changes). Ideally, though, we only do this if someone is actually snapping 3519 // (similar to what happens when the page height changes). Ideally, though, we only do this if someone is actually snapping
3514 // to this grid. 3520 // to this grid.
3515 } 3521 }
3516 3522
3517 } 3523 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698