Source/WebCore/ChangeLog

 12012-08-20 Ryosuke Niwa <rniwa@webkit.org>
 2
 3 Replace isolate || bidi-override by isolate-override
 4 https://bugs.webkit.org/show_bug.cgi?id=89746
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 The combination of bidi-isolate and isolate was replaced by a single isolate-override in
 9 http://lists.w3.org/Archives/Public/www-style/2012May/0541.html. The spec. has been updated accordingly:
 10 http://dev.w3.org/csswg/css3-writing-modes/#unicode-bidi
 11
 12 To follow the specification change, added -webkit-isolate-override and removed the support for
 13 isolate || bidi-override, simplifying the CSS parser and serializer.
 14
 15 Test: fast/text/bidi-override-isolate.html
 16
 17 * css/CSSComputedStyleDeclaration.cpp:
 18 (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Removed. We can just new a CSSPrimitiveValue
 19 constructor now.
 20 * css/CSSParser.cpp:
 21 (WebCore::CSSParser::parseValue):
 22 * css/CSSPrimitiveValueMappings.h:
 23 (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Added now that unicode-bidi always creates a signle
 24 primitive value instead of a primitive value of css value list.
 25 (WebCore::CSSPrimitiveValue::operator EUnicodeBidi):
 26 * css/CSSValueKeywords.in: Added -webkit-isolate-override
 27 * css/StyleBuilder.cpp:
 28 (WebCore): Removed ApplyPropertyUnicodeBidi since we can use ApplyPropertyDefault now.
 29 (WebCore::StyleBuilder::StyleBuilder): Use ApplyPropertyDefault.
 30 * platform/text/UnicodeBidi.h: Renamed OverrideIsolate to IsolateOverride to match the spec.
 31 (WebCore::isIsolated):
 32 (WebCore::isOverride):
 33 * rendering/RenderBlockLineLayout.cpp:
 34 (WebCore::constructBidiRuns):
 35
1362012-08-20 John Mellor <johnme@chromium.org>
237
338 Text Autosizing: Only take into account block width <= document layout width.
126061

Source/WebCore/css/CSSComputedStyleDeclaration.cpp

@@static PassRefPtr<CSSPrimitiveValue> val
11761176 return cssValuePool().createValue(family.string(), CSSPrimitiveValue::CSS_STRING);
11771177}
11781178
1179 static PassRefPtr<CSSValue> renderUnicodeBidiFlagsToCSSValue(EUnicodeBidi unicodeBidi)
1180 {
1181  switch (unicodeBidi) {
1182  case UBNormal:
1183  return cssValuePool().createIdentifierValue(CSSValueNormal);
1184  case Embed:
1185  return cssValuePool().createIdentifierValue(CSSValueEmbed);
1186  case Plaintext:
1187  return cssValuePool().createIdentifierValue(CSSValueWebkitPlaintext);
1188  case Override:
1189  return cssValuePool().createIdentifierValue(CSSValueBidiOverride);
1190  case Isolate:
1191  return cssValuePool().createIdentifierValue(CSSValueWebkitIsolate);
1192  case OverrideIsolate:
1193  {
1194  RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
1195  list->append(cssValuePool().createIdentifierValue(CSSValueBidiOverride));
1196  list->append(cssValuePool().createIdentifierValue(CSSValueWebkitIsolate));
1197  return list;
1198  }
1199  }
1200  ASSERT_NOT_REACHED();
1201  return 0;
1202 }
1203 
12041179static PassRefPtr<CSSValue> renderTextDecorationFlagsToCSSValue(int textDecoration)
12051180{
12061181 // Blink value is ignored.

@@PassRefPtr<CSSValue> CSSComputedStyleDec
20171992 case CSSPropertyTop:
20181993 return getPositionOffsetValue(style.get(), CSSPropertyTop, m_node->document()->renderView());
20191994 case CSSPropertyUnicodeBidi:
2020  return renderUnicodeBidiFlagsToCSSValue(style->unicodeBidi());
 1995 return cssValuePool().createValue(style->unicodeBidi());
20211996 case CSSPropertyVerticalAlign:
20221997 switch (style->verticalAlign()) {
20231998 case BASELINE:
126045

Source/WebCore/css/CSSParser.cpp

@@bool CSSParser::parseValue(CSSPropertyID
17191719 else
17201720 return parseQuotes(propId, important);
17211721 break;
1722  case CSSPropertyUnicodeBidi: // normal | embed | (bidi-override || isolate) | plaintext | inherit
 1722 case CSSPropertyUnicodeBidi: // normal | embed | bidi-override | isolate | isolate-override | plaintext | inherit
17231723 if (id == CSSValueNormal
17241724 || id == CSSValueEmbed
 1725 || id == CSSValueBidiOverride
 1726 || id == CSSValueWebkitIsolate
 1727 || id == CSSValueWebkitIsolateOverride
17251728 || id == CSSValueWebkitPlaintext)
17261729 validPrimitive = true;
1727  else {
1728  RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
1729  bool isValid = true;
1730  while (isValid && value) {
1731  switch (value->id) {
1732  case CSSValueBidiOverride:
1733  case CSSValueWebkitIsolate:
1734  list->append(cssValuePool().createIdentifierValue(value->id));
1735  break;
1736  default:
1737  isValid = false;
1738  }
1739  value = m_valueList->next();
1740  }
1741  if (list->length() && isValid) {
1742  parsedValue = list.release();
1743  m_valueList->next();
1744  }
1745  }
17461730 break;
17471731
17481732 case CSSPropertyContent: // [ <string> | <uri> | <counter> | attr(X) | open-quote |
126045

Source/WebCore/css/CSSPrimitiveValueMappings.h

@@template<> inline CSSPrimitiveValue::ope
22722272 return TTNONE;
22732273}
22742274
 2275template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EUnicodeBidi e)
 2276 : CSSValue(PrimitiveClass)
 2277{
 2278 m_primitiveUnitType = CSS_IDENT;
 2279 switch (e) {
 2280 case UBNormal:
 2281 m_value.ident = CSSValueNormal;
 2282 break;
 2283 case Embed:
 2284 m_value.ident = CSSValueEmbed;
 2285 break;
 2286 case Override:
 2287 m_value.ident = CSSValueBidiOverride;
 2288 break;
 2289 case Isolate:
 2290 m_value.ident = CSSValueWebkitIsolate;
 2291 break;
 2292 case IsolateOverride:
 2293 m_value.ident = CSSValueWebkitIsolateOverride;
 2294 break;
 2295 case Plaintext:
 2296 m_value.ident = CSSValueWebkitPlaintext;
 2297 break;
 2298 }
 2299}
 2300
22752301template<> inline CSSPrimitiveValue::operator EUnicodeBidi() const
22762302{
22772303 switch (m_value.ident) {

@@template<> inline CSSPrimitiveValue::ope
22832309 return Override;
22842310 case CSSValueWebkitIsolate:
22852311 return Isolate;
 2312 case CSSValueWebkitIsolateOverride:
 2313 return IsolateOverride;
22862314 case CSSValueWebkitPlaintext:
22872315 return Plaintext;
22882316 }
126045

Source/WebCore/css/CSSValueKeywords.in

@@hide
422422higher
423423invert
424424-webkit-isolate
 425-webkit-isolate-override
425426-webkit-plaintext
426427landscape
427428ledger
126045

Source/WebCore/css/StyleBuilder.cpp

@@public:
11701170 }
11711171};
11721172
1173 class ApplyPropertyUnicodeBidi {
1174 public:
1175  static void applyValue(StyleResolver* styleResolver, CSSValue* value)
1176  {
1177  if (value->isValueList()) {
1178  EUnicodeBidi rendererUnicodeBidi = RenderStyle::initialUnicodeBidi();
1179  for (CSSValueListIterator i = value; i.hasMore(); i.advance()) {
1180  CSSValue* item = i.value();
1181  ASSERT(item->isPrimitiveValue());
1182  EUnicodeBidi currentValue = *static_cast<CSSPrimitiveValue*>(item);
1183  ASSERT(currentValue == Override || currentValue == Isolate);
1184  if (currentValue != rendererUnicodeBidi && rendererUnicodeBidi != RenderStyle::initialUnicodeBidi())
1185  rendererUnicodeBidi = OverrideIsolate;
1186  else
1187  rendererUnicodeBidi = currentValue;
1188  }
1189  styleResolver->style()->setUnicodeBidi(rendererUnicodeBidi);
1190  }
1191  if (!value->isPrimitiveValue())
1192  return;
1193  CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
1194  styleResolver->style()->setUnicodeBidi(*primitiveValue);
1195  }
1196  static PropertyHandler createHandler()
1197  {
1198  PropertyHandler handler = ApplyPropertyDefaultBase<EUnicodeBidi, &RenderStyle::unicodeBidi, EUnicodeBidi, &RenderStyle::setUnicodeBidi, EUnicodeBidi, &RenderStyle::initialUnicodeBidi>::createHandler();
1199  return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
1200  }
1201 };
1202 
12031173class ApplyPropertyLineHeight {
12041174public:
12051175 static void applyValue(StyleResolver* styleResolver, CSSValue* value)

@@StyleBuilder::StyleBuilder()
19401910 setPropertyHandler(CSSPropertyTextRendering, ApplyPropertyFont<TextRenderingMode, &FontDescription::textRenderingMode, &FontDescription::setTextRenderingMode, AutoTextRendering>::createHandler());
19411911 setPropertyHandler(CSSPropertyTextTransform, ApplyPropertyDefault<ETextTransform, &RenderStyle::textTransform, ETextTransform, &RenderStyle::setTextTransform, ETextTransform, &RenderStyle::initialTextTransform>::createHandler());
19421912 setPropertyHandler(CSSPropertyTop, ApplyPropertyLength<&RenderStyle::top, &RenderStyle::setTop, &RenderStyle::initialOffset, AutoEnabled>::createHandler());
1943  setPropertyHandler(CSSPropertyUnicodeBidi, ApplyPropertyUnicodeBidi::createHandler());
 1913 setPropertyHandler(CSSPropertyUnicodeBidi, ApplyPropertyDefault<EUnicodeBidi, &RenderStyle::unicodeBidi, EUnicodeBidi, &RenderStyle::setUnicodeBidi, EUnicodeBidi, &RenderStyle::initialUnicodeBidi>::createHandler());
19441914 setPropertyHandler(CSSPropertyVerticalAlign, ApplyPropertyVerticalAlign::createHandler());
19451915 setPropertyHandler(CSSPropertyVisibility, ApplyPropertyDefault<EVisibility, &RenderStyle::visibility, EVisibility, &RenderStyle::setVisibility, EVisibility, &RenderStyle::initialVisibility>::createHandler());
19461916 setPropertyHandler(CSSPropertyWebkitAnimationDelay, ApplyPropertyAnimation<double, &Animation::delay, &Animation::setDelay, &Animation::isDelaySet, &Animation::clearDelay, &Animation::initialAnimationDelay, &CSSToStyleMap::mapAnimationDelay, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
126045

Source/WebCore/platform/text/UnicodeBidi.h

@@enum EUnicodeBidi {
3434 Override,
3535 Isolate,
3636 Plaintext,
37  OverrideIsolate,
 37 IsolateOverride,
3838};
3939
4040inline bool isIsolated(const EUnicodeBidi& unicodeBidi)
4141{
42  return unicodeBidi == Isolate || unicodeBidi == OverrideIsolate || unicodeBidi == Plaintext;
 42 return unicodeBidi == Isolate || unicodeBidi == IsolateOverride || unicodeBidi == Plaintext;
4343}
4444
4545inline bool isOverride(EUnicodeBidi unicodeBidi)
4646{
47  return unicodeBidi == Override || unicodeBidi == OverrideIsolate;
 47 return unicodeBidi == Override || unicodeBidi == IsolateOverride;
4848}
4949
5050}
126045

Source/WebCore/rendering/RenderBlockLineLayout.cpp

@@static inline void constructBidiRuns(Inl
997997 if (unicodeBidi == Plaintext)
998998 determineDirectionality(direction, InlineIterator(isolatedInline, isolatedRun->object(), 0));
999999 else {
1000  ASSERT(unicodeBidi == Isolate || unicodeBidi == OverrideIsolate);
 1000 ASSERT(unicodeBidi == Isolate || unicodeBidi == IsolateOverride);
10011001 direction = isolatedInline->style()->direction();
10021002 }
10031003 isolatedResolver.setStatus(statusWithDirection(direction, isOverride(unicodeBidi)));
126045

LayoutTests/ChangeLog

 12012-08-20 Ryosuke Niwa <rniwa@webkit.org>
 2
 3 Replace isolate || bidi-override by isolate-override
 4 https://bugs.webkit.org/show_bug.cgi?id=89746
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 Rebaseline test expectations. These tests test the new behavior and new property value -webkit-isolate-override.
 9
 10 * fast/css/unicode-bidi-computed-value-expected.txt:
 11 * fast/css/unicode-bidi-computed-value.html:
 12 * fast/text/bidi-override-isolate.html:
 13
1142012-08-20 Bruno de Oliveira Abinader <bruno.abinader@basyskom.com>
215
316 [css3-text] Add getComputedStyle tests for -webkit-text-decoration-line
126061

LayoutTests/fast/css/unicode-bidi-computed-value-expected.txt

@@PASS styleOf("span", {"style":"unicode-b
88PASS styleOf("span", {"style":"unicode-bidi: bad-value;"}).unicodeBidi is "normal"
99PASS styleOf("span", {"style":"unicode-bidi: embed embed;"}).unicodeBidi is "normal"
1010PASS styleOf("span", {"style":"unicode-bidi: embed -webkit-plain-text;"}).unicodeBidi is "normal"
11 PASS styleOf("span", {"style":"unicode-bidi: bidi-override -webkit-isolate;"}).unicodeBidi is "bidi-override -webkit-isolate"
12 PASS styleOf("span", {"style":"unicode-bidi: -webkit-isolate bidi-override;"}).unicodeBidi is "bidi-override -webkit-isolate"
13 PASS styleOf("span", {"style":"unicode-bidi: bidi-override -webkit-isolate bidi-override;"}).unicodeBidi is "bidi-override -webkit-isolate"
14 PASS styleOf("span", {"style":"unicode-bidi: bidi-override -webkit-isolate -webkit-isolate;"}).unicodeBidi is "bidi-override -webkit-isolate"
 11PASS styleOf("span", {"style":"unicode-bidi: bidi-override -webkit-isolate;"}).unicodeBidi is "normal"
 12PASS styleOf("span", {"style":"unicode-bidi: -webkit-isolate bidi-override;"}).unicodeBidi is "normal"
 13PASS styleOf("span", {"style":"unicode-bidi: -webkit-isolate-override;"}).unicodeBidi is "-webkit-isolate-override"
 14PASS styleOf("span", {"style":"unicode-bidi: bidi-override -webkit-isolate bidi-override;"}).unicodeBidi is "normal"
 15PASS styleOf("span", {"style":"unicode-bidi: bidi-override -webkit-isolate -webkit-isolate;"}).unicodeBidi is "normal"
1516PASS styleOf("span", {"style":"unicode-bidi: bidi-override bad-value;"}).unicodeBidi is "normal"
1617PASS styleOf("span", {"style":"unicode-bidi: bidi-override embed;"}).unicodeBidi is "normal"
1718
126045

LayoutTests/fast/css/unicode-bidi-computed-value.html

@@var tests = [
2828 ['span', {'style': 'unicode-bidi: bad-value;'}, 'normal'],
2929 ['span', {'style': 'unicode-bidi: embed embed;'}, 'normal'],
3030 ['span', {'style': 'unicode-bidi: embed -webkit-plain-text;'}, 'normal'],
31  ['span', {'style': 'unicode-bidi: bidi-override -webkit-isolate;'}, 'bidi-override -webkit-isolate'],
32  ['span', {'style': 'unicode-bidi: -webkit-isolate bidi-override;'}, 'bidi-override -webkit-isolate'],
33  ['span', {'style': 'unicode-bidi: bidi-override -webkit-isolate bidi-override;'}, 'bidi-override -webkit-isolate'],
34  ['span', {'style': 'unicode-bidi: bidi-override -webkit-isolate -webkit-isolate;'}, 'bidi-override -webkit-isolate'],
 31 ['span', {'style': 'unicode-bidi: bidi-override -webkit-isolate;'}, 'normal'],
 32 ['span', {'style': 'unicode-bidi: -webkit-isolate bidi-override;'}, 'normal'],
 33 ['span', {'style': 'unicode-bidi: -webkit-isolate-override;'}, '-webkit-isolate-override'],
 34 ['span', {'style': 'unicode-bidi: bidi-override -webkit-isolate bidi-override;'}, 'normal'],
 35 ['span', {'style': 'unicode-bidi: bidi-override -webkit-isolate -webkit-isolate;'}, 'normal'],
3536 ['span', {'style': 'unicode-bidi: bidi-override bad-value;'}, 'normal'],
3637 ['span', {'style': 'unicode-bidi: bidi-override embed;'}, 'normal'],
3738].forEach(function (test) {
126045

LayoutTests/fast/text/bidi-override-isolate.html

66<div style="font-size: 3em;">
77<div><span style="direction: rtl; unicode-bidi: -webkit-isolate isolate;">abc</span> 1</div>
88<div><span style="direction: rtl; unicode-bidi: bidi-override;">abc</span> 1</div>
9 <div><span style="direction: rtl; unicode-bidi: bidi-override -webkit-isolate; unicode-bidi: bidi-override isolate;">abc</span> 1</div>
10 <div><span style="direction: rtl; unicode-bidi: -webkit-isolate bidi-override; unicode-bidi: isolate bidi-override;">abc</span> 1</div>
11 <div><span style="direction: rtl; unicode-bidi: bidi-override bidi-override;
 9<div><span style="direction: rtl; unicode-bidi: -webkit-isolate-override; unicode-bidi: isolate-override;">abc</span> 1</div>
 10<div><span style="direction: rtl; unicode-bidi: -webkit-isolate-override; unicode-bidi: isolate-override;">abc</span> 1</div>
 11<div><span style="direction: rtl; unicode-bidi: bidi-override;
1212unicode-bidi: -webkit-bad-value -webkit-isolate; unicode-bidi: -bad-value isolate;">abc</span> 1</div>
13 <div><span style="direction: rtl; unicode-bidi: -webkit-isolate -webkit-isolate; unicode-bidi: isolate isolate;
 13<div><span style="direction: rtl; unicode-bidi: -webkit-isolate; unicode-bidi: isolate;
1414unicode-bidi: -bad-value bidi-override;">abc</span> 1</div>
1515</div>
1616
126045