Changeset 107000 in webkit
- Timestamp:
- Feb 7, 2012 3:46:40 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r106995 r107000 1 2012-02-07 Levi Weintraub <leviw@chromium.org> 2 3 unicode-bidi:plaintext is supposed to be effective on display:inline elements too 4 https://bugs.webkit.org/show_bug.cgi?id=73310 5 6 Reviewed by Eric Seidel. 7 8 Ref tests for unicode-bidi: plaintext on inlines. 9 10 * fast/text/international/inline-plaintext-is-isolated-expected.html: Added. 11 * fast/text/international/inline-plaintext-is-isolated.html: Added. 12 * fast/text/international/inline-plaintext-relayout-with-leading-neutrals-expected.html: Added. 13 * fast/text/international/inline-plaintext-relayout-with-leading-neutrals.html: Added. 14 * fast/text/international/inline-plaintext-with-generated-content-expected.html: Added. 15 * fast/text/international/inline-plaintext-with-generated-content.html: Added. 16 1 17 2012-02-07 Julien Chaffraix <jchaffraix@webkit.org> 2 18 -
trunk/Source/WebCore/ChangeLog
r106998 r107000 1 2012-02-07 Levi Weintraub <leviw@chromium.org> 2 3 unicode-bidi:plaintext is supposed to be effective on display:inline elements too 4 https://bugs.webkit.org/show_bug.cgi?id=73310 5 6 Reviewed by Eric Seidel. 7 8 Adding support for unicode-bidi: plaintext as a property on inlines. These are treated 9 like unicode-bidi: isolate with the addition of their directionality being determined 10 by the UBA. 11 12 Tests: fast/text/international/inline-plaintext-is-isolated-expected.html 13 fast/text/international/inline-plaintext-is-isolated.html 14 fast/text/international/inline-plaintext-relayout-with-leading-neutrals-expected.html 15 fast/text/international/inline-plaintext-relayout-with-leading-neutrals.html 16 fast/text/international/inline-plaintext-with-generated-content-expected.html 17 fast/text/international/inline-plaintext-with-generated-content.html 18 19 * platform/text/UnicodeBidi.h: 20 (WebCore::isIsolated): Added this convenience function as Plaintext and Isolate Unicode-Bidi values 21 are both treated as isolated content. 22 * rendering/InlineIterator.h: 23 (WebCore::notifyObserverEnteredObject): Inline now supports Unicode-Bidi Plaintext. 24 (WebCore::notifyObserverWillExitObject): Ditto. 25 (WebCore::bidiFirstSkippingEmptyInlines): Changed to support being called without a resolver. 26 (WebCore::isIsolatedInline): Inline now supports Unicode-Bidi: Plaintext. 27 * rendering/RenderBlockLineLayout.cpp: 28 (WebCore::determineDirectionality): Generalized for inlines. 29 (WebCore::constructBidiRuns): Added support for Unicode-Bidi: Plaintext as an isolated inline. 30 (WebCore::RenderBlock::layoutRunsAndFloatsInRange): Fixed comment. 31 (WebCore::RenderBlock::determineStartPosition): Fixed comment and switched to updated 32 bidiFirstSkippingEmptyInlines. 33 1 34 2012-02-07 Kentaro Hara <haraken@chromium.org> 2 35 -
trunk/Source/WebCore/platform/text/UnicodeBidi.h
r95901 r107000 35 35 Isolate, 36 36 Plaintext 37 }; 37 }; 38 39 inline bool isIsolated(const EUnicodeBidi& unicodeBidi) 40 { 41 return unicodeBidi == Isolate || unicodeBidi == Plaintext; 42 } 38 43 39 44 } -
trunk/Source/WebCore/rendering/InlineIterator.h
r102875 r107000 132 132 return; 133 133 } 134 if ( unicodeBidi == Isolate) {134 if (isIsolated(unicodeBidi)) { 135 135 observer->enterIsolate(); 136 136 // Embedding/Override characters implied by dir= are handled when … … 139 139 } 140 140 141 // FIXME: Should unicode-bidi: plaintext really be embedding override/embed characters here?142 141 if (!observer->inIsolate()) 143 142 observer->embed(embedCharFromDirection(style->direction(), unicodeBidi), FromStyleOrDOM); … … 153 152 if (unicodeBidi == UBNormal) 154 153 return; // Nothing to do for unicode-bidi: normal 155 if ( unicodeBidi == Isolate) {154 if (isIsolated(unicodeBidi)) { 156 155 observer->exitIsolate(); 157 156 return; … … 256 255 } 257 256 258 static inline RenderObject* bidiFirstSkippingEmptyInlines(RenderObject* root, InlineBidiResolver* resolver) 259 { 260 ASSERT(resolver); 257 static inline RenderObject* bidiFirstSkippingEmptyInlines(RenderObject* root, InlineBidiResolver* resolver = 0) 258 { 261 259 RenderObject* o = root->firstChild(); 262 260 if (!o) … … 279 277 o = bidiNextSkippingEmptyInlines(root, o, resolver); 280 278 281 resolver->commitExplicitEmbedding(); 279 if (resolver) 280 resolver->commitExplicitEmbedding(); 282 281 return o; 283 282 } … … 393 392 { 394 393 ASSERT(object); 395 return object->isRenderInline() && object->style()->unicodeBidi() == Isolate;394 return object->isRenderInline() && isIsolated(object->style()->unicodeBidi()); 396 395 } 397 396 -
trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp
r105423 r107000 259 259 } 260 260 261 static void determine ParagraphDirection(TextDirection& dir, InlineIterator iter)261 static void determineDirectionality(TextDirection& dir, InlineIterator iter) 262 262 { 263 263 while (!iter.atEnd()) { … … 971 971 // to take a RenderObject and do this logic there, but that would be a layering 972 972 // violation for BidiResolver (which knows nothing about RenderObject). 973 RenderInline* isolated Span= toRenderInline(containingIsolate(startObj, currentRoot));973 RenderInline* isolatedInline = toRenderInline(containingIsolate(startObj, currentRoot)); 974 974 InlineBidiResolver isolatedResolver; 975 isolatedResolver.setStatus(statusWithDirection(isolatedSpan->style()->direction())); 975 EUnicodeBidi unicodeBidi = isolatedInline->style()->unicodeBidi(); 976 TextDirection direction; 977 if (unicodeBidi == Plaintext) 978 determineDirectionality(direction, InlineIterator(isolatedInline, isolatedRun->object(), 0)); 979 else { 980 ASSERT(unicodeBidi == Isolate); 981 direction = isolatedInline->style()->direction(); 982 } 983 isolatedResolver.setStatus(statusWithDirection(direction)); 976 984 977 985 // FIXME: The fact that we have to construct an Iterator here 978 986 // currently prevents this code from moving into BidiResolver. 979 if (!bidiFirstSkippingEmptyInlines(isolated Span, &isolatedResolver))987 if (!bidiFirstSkippingEmptyInlines(isolatedInline, &isolatedResolver)) 980 988 continue; 989 981 990 // The starting position is the beginning of the first run within the isolate that was identified 982 991 // during the earlier call to createBidiRunsForLine. This can be but is not necessarily the 983 992 // first run within the isolate. 984 InlineIterator iter = InlineIterator(isolated Span, startObj, isolatedRun->m_start);993 InlineIterator iter = InlineIterator(isolatedInline, startObj, isolatedRun->m_start); 985 994 isolatedResolver.setPositionIgnoringNestedIsolates(iter); 986 995 … … 1241 1250 end = lineBreaker.nextLineBreak(resolver, layoutState.lineInfo(), lineBreakIteratorInfo, lastFloatFromPreviousLine, consecutiveHyphenatedLines); 1242 1251 if (resolver.position().atEnd()) { 1243 // FIXME: We shouldn't be creating any runs in findNextLineBreak to begin with!1252 // FIXME: We shouldn't be creating any runs in nextLineBreak to begin with! 1244 1253 // Once BidiRunList is separated from BidiResolver this will not be needed. 1245 1254 resolver.runs().deleteRuns(); … … 1260 1269 if (isNewUBAParagraph && styleToUse->unicodeBidi() == Plaintext && !resolver.context()->parent()) { 1261 1270 TextDirection direction = styleToUse->direction(); 1262 determine ParagraphDirection(direction, resolver.position());1271 determineDirectionality(direction, resolver.position()); 1263 1272 resolver.setStatus(BidiStatus(direction, styleToUse->unicodeBidi() == Override)); 1264 1273 } … … 1669 1678 } else { 1670 1679 TextDirection direction = style()->direction(); 1671 if (style()->unicodeBidi() == Plaintext) { 1672 // FIXME: Why does "unicode-bidi: plaintext" bidiFirstIncludingEmptyInlines when all other line layout code uses bidiFirstSkippingEmptyInlines? 1673 determineParagraphDirection(direction, InlineIterator(this, bidiFirstIncludingEmptyInlines(this), 0)); 1674 } 1680 if (style()->unicodeBidi() == Plaintext) 1681 determineDirectionality(direction, InlineIterator(this, bidiFirstSkippingEmptyInlines(this), 0)); 1675 1682 resolver.setStatus(BidiStatus(direction, style()->unicodeBidi() == Override)); 1676 1683 InlineIterator iter = InlineIterator(this, bidiFirstSkippingEmptyInlines(this, &resolver), 0);
Note: See TracChangeset
for help on using the changeset viewer.