Attachment #525114: Style system support for unicode-bidi: -moz-isolate and -moz-plaintext for bug #613149

View | Details | Raw Unified | Return to bug 613149
Collapse All | Expand All

(-)a/layout/base/nsBidiPresUtils.cpp (-20 / +15 lines)
Line     Link Here 
 Lines 475-491   nsBidiPresUtils::Resolve(nsBlockFrame* a Link Here 
475
{
475
{
476
  BidiParagraphData bpd;
476
  BidiParagraphData bpd;
477
  bpd.Init(aBlockFrame);
477
  bpd.Init(aBlockFrame);
478
478
479
  // handle bidi-override being set on the block itself before calling
479
  // handle bidi-override being set on the block itself before calling
480
  // TraverseFrames.
480
  // TraverseFrames.
481
  const nsStyleTextReset* text = aBlockFrame->GetStyleTextReset();
481
  const nsStyleTextReset* text = aBlockFrame->GetStyleTextReset();
482
  PRUnichar ch = 0;
482
  PRUnichar ch = 0;
483
  if (text->mUnicodeBidi == NS_STYLE_UNICODE_BIDI_OVERRIDE) {
483
  if (text->mUnicodeBidi & NS_STYLE_UNICODE_BIDI_OVERRIDE) {
484
    const nsStyleVisibility* vis = aBlockFrame->GetStyleVisibility();
484
    const nsStyleVisibility* vis = aBlockFrame->GetStyleVisibility();
485
    if (NS_STYLE_DIRECTION_RTL == vis->mDirection) {
485
    if (NS_STYLE_DIRECTION_RTL == vis->mDirection) {
486
      ch = kRLO;
486
      ch = kRLO;
487
    }
487
    }
488
    else if (NS_STYLE_DIRECTION_LTR == vis->mDirection) {
488
    else if (NS_STYLE_DIRECTION_LTR == vis->mDirection) {
489
      ch = kLRO;
489
      ch = kLRO;
490
    }
490
    }
491
    if (ch != 0) {
491
    if (ch != 0) {
 Lines 798-832   nsBidiPresUtils::TraverseFrames(nsBlockF Link Here 
798
        frame = realFrame;
798
        frame = realFrame;
799
      }
799
      }
800
    }
800
    }
801
801
802
    PRUnichar ch = 0;
802
    PRUnichar ch = 0;
803
    if (frame->IsFrameOfType(nsIFrame::eBidiInlineContainer)) {
803
    if (frame->IsFrameOfType(nsIFrame::eBidiInlineContainer)) {
804
      const nsStyleVisibility* vis = frame->GetStyleVisibility();
804
      const nsStyleVisibility* vis = frame->GetStyleVisibility();
805
      const nsStyleTextReset* text = frame->GetStyleTextReset();
805
      const nsStyleTextReset* text = frame->GetStyleTextReset();
806
      switch (text->mUnicodeBidi) {
806
      if (text->mUnicodeBidi & NS_STYLE_UNICODE_BIDI_OVERRIDE) {
807
        case NS_STYLE_UNICODE_BIDI_NORMAL:
807
        if (NS_STYLE_DIRECTION_RTL == vis->mDirection) {
808
          break;
808
          ch = kRLO;
809
        case NS_STYLE_UNICODE_BIDI_EMBED:
809
        }
810
          if (NS_STYLE_DIRECTION_RTL == vis->mDirection) {
810
        else if (NS_STYLE_DIRECTION_LTR == vis->mDirection) {
811
            ch = kRLE;
811
          ch = kLRO;
812
          }
812
        }
813
          else if (NS_STYLE_DIRECTION_LTR == vis->mDirection) {
813
      } else if (text->mUnicodeBidi & NS_STYLE_UNICODE_BIDI_EMBED) {
814
            ch = kLRE;
814
        if (NS_STYLE_DIRECTION_RTL == vis->mDirection) {
815
          }
815
          ch = kRLE;
816
          break;
816
        }
817
        case NS_STYLE_UNICODE_BIDI_OVERRIDE:
817
        else if (NS_STYLE_DIRECTION_LTR == vis->mDirection) {
818
          if (NS_STYLE_DIRECTION_RTL == vis->mDirection) {
818
          ch = kLRE;
819
            ch = kRLO;
819
        }
820
          }
821
          else if (NS_STYLE_DIRECTION_LTR == vis->mDirection) {
822
            ch = kLRO;
823
          }
824
          break;
825
      }
820
      }
826
821
827
      // Add a dummy frame pointer representing a bidi control code before the
822
      // Add a dummy frame pointer representing a bidi control code before the
828
      // first frame of an element specifying embedding or override
823
      // first frame of an element specifying embedding or override
829
      if (ch != 0 && !frame->GetPrevContinuation()) {
824
      if (ch != 0 && !frame->GetPrevContinuation()) {
830
        aBpd->PushBidiControl(ch);
825
        aBpd->PushBidiControl(ch);
831
      }
826
      }
832
    }
827
    }
(-)a/layout/base/nsStyleConsts.h (-3 / +7 lines)
Line     Link Here 
 Lines 680-698   static inline mozilla::css::Side operato Link Here 
680
// See nsStyleText
680
// See nsStyleText
681
#define NS_STYLE_WORDWRAP_NORMAL                0
681
#define NS_STYLE_WORDWRAP_NORMAL                0
682
#define NS_STYLE_WORDWRAP_BREAK_WORD            1
682
#define NS_STYLE_WORDWRAP_BREAK_WORD            1
683
683
684
// See nsStyleText
684
// See nsStyleText
685
#define NS_STYLE_LINE_HEIGHT_BLOCK_HEIGHT       0
685
#define NS_STYLE_LINE_HEIGHT_BLOCK_HEIGHT       0
686
686
687
// See nsStyleText
687
// See nsStyleText
688
#define NS_STYLE_UNICODE_BIDI_NORMAL            0
688
#define NS_STYLE_UNICODE_BIDI_NORMAL            0x0
689
#define NS_STYLE_UNICODE_BIDI_EMBED             1
689
#define NS_STYLE_UNICODE_BIDI_EMBED             0x1
690
#define NS_STYLE_UNICODE_BIDI_OVERRIDE          2
690
#define NS_STYLE_UNICODE_BIDI_MOZ_ISOLATE       0x2
691
#define NS_STYLE_UNICODE_BIDI_EMBEDDING_MASK    0x3
692
#define NS_STYLE_UNICODE_BIDI_OVERRIDE          0x4
693
#define NS_STYLE_UNICODE_BIDI_MOZ_PLAINTEXT     0x8
694
#define NS_STYLE_UNICODE_BIDI_DIRECTION_MASK    0xC
691
695
692
// See nsStyleTable (here for HTML 4.0 for now, should probably change to side flags)
696
// See nsStyleTable (here for HTML 4.0 for now, should probably change to side flags)
693
#define NS_STYLE_TABLE_FRAME_NONE               0
697
#define NS_STYLE_TABLE_FRAME_NONE               0
694
#define NS_STYLE_TABLE_FRAME_ABOVE              1
698
#define NS_STYLE_TABLE_FRAME_ABOVE              1
695
#define NS_STYLE_TABLE_FRAME_BELOW              2
699
#define NS_STYLE_TABLE_FRAME_BELOW              2
696
#define NS_STYLE_TABLE_FRAME_HSIDES             3
700
#define NS_STYLE_TABLE_FRAME_HSIDES             3
697
#define NS_STYLE_TABLE_FRAME_VSIDES             4
701
#define NS_STYLE_TABLE_FRAME_VSIDES             4
698
#define NS_STYLE_TABLE_FRAME_LEFT               5
702
#define NS_STYLE_TABLE_FRAME_LEFT               5
(-)a/layout/style/nsCSSKeywordList.h (+2 lines)
Line     Link Here 
 Lines 121-136   CSS_KEY(-moz-hyperlinktext, _moz_hyperli Link Here 
121
CSS_KEY(-moz-html-cellhighlight, _moz_html_cellhighlight)
121
CSS_KEY(-moz-html-cellhighlight, _moz_html_cellhighlight)
122
CSS_KEY(-moz-html-cellhighlighttext, _moz_html_cellhighlighttext)
122
CSS_KEY(-moz-html-cellhighlighttext, _moz_html_cellhighlighttext)
123
CSS_KEY(-moz-image-rect, _moz_image_rect)
123
CSS_KEY(-moz-image-rect, _moz_image_rect)
124
CSS_KEY(-moz-info, _moz_info)
124
CSS_KEY(-moz-info, _moz_info)
125
CSS_KEY(-moz-initial, _moz_initial)
125
CSS_KEY(-moz-initial, _moz_initial)
126
CSS_KEY(-moz-inline-box, _moz_inline_box)
126
CSS_KEY(-moz-inline-box, _moz_inline_box)
127
CSS_KEY(-moz-inline-grid, _moz_inline_grid)
127
CSS_KEY(-moz-inline-grid, _moz_inline_grid)
128
CSS_KEY(-moz-inline-stack, _moz_inline_stack)
128
CSS_KEY(-moz-inline-stack, _moz_inline_stack)
129
CSS_KEY(-moz-isolate, _moz_isolate)
129
CSS_KEY(-moz-japanese-formal, _moz_japanese_formal)
130
CSS_KEY(-moz-japanese-formal, _moz_japanese_formal)
130
CSS_KEY(-moz-japanese-informal, _moz_japanese_informal)
131
CSS_KEY(-moz-japanese-informal, _moz_japanese_informal)
131
CSS_KEY(-moz-kannada, _moz_kannada)
132
CSS_KEY(-moz-kannada, _moz_kannada)
132
CSS_KEY(-moz-khmer, _moz_khmer)
133
CSS_KEY(-moz-khmer, _moz_khmer)
133
CSS_KEY(-moz-lao, _moz_lao)
134
CSS_KEY(-moz-lao, _moz_lao)
134
CSS_KEY(-moz-left, _moz_left)
135
CSS_KEY(-moz-left, _moz_left)
135
CSS_KEY(-moz-list, _moz_list)
136
CSS_KEY(-moz-list, _moz_list)
136
CSS_KEY(-moz-mac-alternateprimaryhighlight, _moz_mac_alternateprimaryhighlight)
137
CSS_KEY(-moz-mac-alternateprimaryhighlight, _moz_mac_alternateprimaryhighlight)
 Lines 152-167   CSS_KEY(-moz-menubarhovertext, _moz_menu Link Here 
152
CSS_KEY(-moz-middle-with-baseline, _moz_middle_with_baseline)
153
CSS_KEY(-moz-middle-with-baseline, _moz_middle_with_baseline)
153
CSS_KEY(-moz-min-content, _moz_min_content)
154
CSS_KEY(-moz-min-content, _moz_min_content)
154
CSS_KEY(-moz-myanmar, _moz_myanmar)
155
CSS_KEY(-moz-myanmar, _moz_myanmar)
155
CSS_KEY(-moz-nativehyperlinktext, _moz_nativehyperlinktext)
156
CSS_KEY(-moz-nativehyperlinktext, _moz_nativehyperlinktext)
156
CSS_KEY(-moz-none, _moz_none)
157
CSS_KEY(-moz-none, _moz_none)
157
CSS_KEY(-moz-oddtreerow, _moz_oddtreerow)
158
CSS_KEY(-moz-oddtreerow, _moz_oddtreerow)
158
CSS_KEY(-moz-oriya, _moz_oriya)
159
CSS_KEY(-moz-oriya, _moz_oriya)
159
CSS_KEY(-moz-persian, _moz_persian)
160
CSS_KEY(-moz-persian, _moz_persian)
161
CSS_KEY(-moz-plaintext, _moz_plaintext)
160
CSS_KEY(-moz-popup, _moz_popup)
162
CSS_KEY(-moz-popup, _moz_popup)
161
CSS_KEY(-moz-pull-down-menu, _moz_pull_down_menu)
163
CSS_KEY(-moz-pull-down-menu, _moz_pull_down_menu)
162
CSS_KEY(-moz-right, _moz_right)
164
CSS_KEY(-moz-right, _moz_right)
163
CSS_KEY(-moz-scrollbars-horizontal, _moz_scrollbars_horizontal)
165
CSS_KEY(-moz-scrollbars-horizontal, _moz_scrollbars_horizontal)
164
CSS_KEY(-moz-scrollbars-none, _moz_scrollbars_none)
166
CSS_KEY(-moz-scrollbars-none, _moz_scrollbars_none)
165
CSS_KEY(-moz-scrollbars-vertical, _moz_scrollbars_vertical)
167
CSS_KEY(-moz-scrollbars-vertical, _moz_scrollbars_vertical)
166
CSS_KEY(-moz-show-background, _moz_show_background)
168
CSS_KEY(-moz-show-background, _moz_show_background)
167
CSS_KEY(-moz-simp-chinese-formal, _moz_simp_chinese_formal)
169
CSS_KEY(-moz-simp-chinese-formal, _moz_simp_chinese_formal)
(-)a/layout/style/nsCSSParser.cpp (-1 / +40 lines)
Line     Link Here 
 Lines 503-518   protected: Link Here 
503
  PRBool ParseMozTransform();
503
  PRBool ParseMozTransform();
504
  PRBool ParseOutline();
504
  PRBool ParseOutline();
505
  PRBool ParseOverflow();
505
  PRBool ParseOverflow();
506
  PRBool ParsePadding();
506
  PRBool ParsePadding();
507
  PRBool ParsePause();
507
  PRBool ParsePause();
508
  PRBool ParseQuotes();
508
  PRBool ParseQuotes();
509
  PRBool ParseSize();
509
  PRBool ParseSize();
510
  PRBool ParseTextDecoration(nsCSSValue& aValue);
510
  PRBool ParseTextDecoration(nsCSSValue& aValue);
511
  PRBool ParseUnicodeBidi(nsCSSValue& aValue);
511
512
512
  PRBool ParseShadowItem(nsCSSValue& aValue, PRBool aIsBoxShadow);
513
  PRBool ParseShadowItem(nsCSSValue& aValue, PRBool aIsBoxShadow);
513
  PRBool ParseShadowList(nsCSSProperty aProperty);
514
  PRBool ParseShadowList(nsCSSProperty aProperty);
514
  PRBool ParseTransitionProperty();
515
  PRBool ParseTransitionProperty();
515
  PRBool ParseTransition();
516
  PRBool ParseTransition();
516
  PRBool ParseTransitionTimingFunctionValues(nsCSSValue& aValue);
517
  PRBool ParseTransitionTimingFunctionValues(nsCSSValue& aValue);
517
  PRBool ParseTransitionTimingFunctionValueComponent(float& aComponent,
518
  PRBool ParseTransitionTimingFunctionValueComponent(float& aComponent,
518
                                                     char aStop,
519
                                                     char aStop,
 Lines 5424-5439   CSSParserImpl::ParseSingleValueProperty( Link Here 
5424
      case eCSSProperty_voice_family:
5425
      case eCSSProperty_voice_family:
5425
        return ParseFamily(aValue);
5426
        return ParseFamily(aValue);
5426
      case eCSSProperty_font_weight:
5427
      case eCSSProperty_font_weight:
5427
        return ParseFontWeight(aValue);
5428
        return ParseFontWeight(aValue);
5428
      case eCSSProperty_marks:
5429
      case eCSSProperty_marks:
5429
        return ParseMarks(aValue);
5430
        return ParseMarks(aValue);
5430
      case eCSSProperty_text_decoration:
5431
      case eCSSProperty_text_decoration:
5431
        return ParseTextDecoration(aValue);
5432
        return ParseTextDecoration(aValue);
5433
      case eCSSProperty_unicode_bidi:
5434
        return ParseUnicodeBidi(aValue);
5432
      default:
5435
      default:
5433
        NS_ABORT_IF_FALSE(PR_FALSE, "should not reach here");
5436
        NS_ABORT_IF_FALSE(PR_FALSE, "should not reach here");
5434
        return PR_FALSE;
5437
        return PR_FALSE;
5435
    }
5438
    }
5436
  }
5439
  }
5437
5440
5438
  PRUint32 variant = nsCSSProps::ParserVariant(aPropID);
5441
  PRUint32 variant = nsCSSProps::ParserVariant(aPropID);
5439
  if (variant == 0) {
5442
  if (variant == 0) {
 Lines 7853-7869   CSSParserImpl::ParseTextDecoration(nsCSS Link Here 
7853
        }
7856
        }
7854
        aValue.SetIntValue(intValue, eCSSUnit_Enumerated);
7857
        aValue.SetIntValue(intValue, eCSSUnit_Enumerated);
7855
      }
7858
      }
7856
    }
7859
    }
7857
    return PR_TRUE;
7860
    return PR_TRUE;
7858
  }
7861
  }
7859
  return PR_FALSE;
7862
  return PR_FALSE;
7860
}
7863
}
7861
7864
 
7865
PRBool
7866
CSSParserImpl::ParseUnicodeBidi(nsCSSValue& aValue)
7867
{
7868
  if (ParseVariant(aValue, VARIANT_HK, nsCSSProps::kUnicodeBidiKTable)) {
7869
    if (eCSSUnit_Enumerated == aValue.GetUnit()) {
7870
      PRInt32 intValue = aValue.GetIntValue();
7871
      if (intValue != NS_STYLE_UNICODE_BIDI_NORMAL) {
7872
        // look for more keywords
7873
        nsCSSValue  keyword;
7874
        if (ParseEnum(keyword, nsCSSProps::kUnicodeBidiKTable)) {
7875
          PRInt32 newValue = keyword.GetIntValue();
7876
          if (newValue == NS_STYLE_UNICODE_BIDI_NORMAL ||
7877
              newValue & intValue) {
7878
            // 'none' keyword in conjuction with others is not allowed, and
7879
            // duplicate keyword is not allowed.
7880
            return PR_FALSE;
7881
          }
7882
          if ((newValue & NS_STYLE_UNICODE_BIDI_EMBEDDING_MASK) &&
7883
              (intValue & NS_STYLE_UNICODE_BIDI_EMBEDDING_MASK)) {
7884
            // only one of 'embed' and 'isolate' is allowed
7885
            return PR_FALSE;
7886
          }
7887
          if ((newValue & NS_STYLE_UNICODE_BIDI_DIRECTION_MASK) &&
7888
              (intValue & NS_STYLE_UNICODE_BIDI_DIRECTION_MASK)) {
7889
            // only one of 'bidi-override' and 'plaintext' is allowed
7890
            return PR_FALSE;
7891
          }
7892
          intValue |= newValue;
7893
        }
7894
        aValue.SetIntValue(intValue, eCSSUnit_Enumerated);
7895
      }
7896
    }
7897
    return PR_TRUE;
7898
  }
7899
  return PR_FALSE;
7900
}
7862
7901
7863
PRBool
7902
PRBool
7864
CSSParserImpl::ParseTransitionProperty()
7903
CSSParserImpl::ParseTransitionProperty()
7865
{
7904
{
7866
  nsCSSValue value;
7905
  nsCSSValue value;
7867
  if (ParseVariant(value, VARIANT_INHERIT | VARIANT_NONE | VARIANT_ALL,
7906
  if (ParseVariant(value, VARIANT_INHERIT | VARIANT_NONE | VARIANT_ALL,
7868
                   nsnull)) {
7907
                   nsnull)) {
7869
    // 'inherit', 'initial', 'none', and 'all' must be alone
7908
    // 'inherit', 'initial', 'none', and 'all' must be alone
(-)a/layout/style/nsCSSPropList.h (-2 / +3 lines)
Line     Link Here 
 Lines 2291-2308   CSS_PROP_DISPLAY( Link Here 
2291
    VARIANT_TIMING_FUNCTION, // used by list parsing
2291
    VARIANT_TIMING_FUNCTION, // used by list parsing
2292
    kTransitionTimingFunctionKTable,
2292
    kTransitionTimingFunctionKTable,
2293
    CSS_PROP_NO_OFFSET,
2293
    CSS_PROP_NO_OFFSET,
2294
    eStyleAnimType_None)
2294
    eStyleAnimType_None)
2295
CSS_PROP_TEXTRESET(
2295
CSS_PROP_TEXTRESET(
2296
    unicode-bidi,
2296
    unicode-bidi,
2297
    unicode_bidi,
2297
    unicode_bidi,
2298
    UnicodeBidi,
2298
    UnicodeBidi,
2299
    CSS_PROPERTY_PARSE_VALUE,
2299
    CSS_PROPERTY_PARSE_VALUE |
2300
    VARIANT_HK,
2300
        CSS_PROPERTY_VALUE_PARSER_FUNCTION,
2301
    0,
2301
    kUnicodeBidiKTable,
2302
    kUnicodeBidiKTable,
2302
    CSS_PROP_NO_OFFSET,
2303
    CSS_PROP_NO_OFFSET,
2303
    eStyleAnimType_None)
2304
    eStyleAnimType_None)
2304
CSS_PROP_USERINTERFACE(
2305
CSS_PROP_USERINTERFACE(
2305
    -moz-user-focus,
2306
    -moz-user-focus,
2306
    user_focus,
2307
    user_focus,
2307
    CSS_PROP_DOMPROP_PREFIXED(UserFocus),
2308
    CSS_PROP_DOMPROP_PREFIXED(UserFocus),
2308
    CSS_PROPERTY_PARSE_VALUE,
2309
    CSS_PROPERTY_PARSE_VALUE,
(-)a/layout/style/nsCSSProps.cpp (+2 lines)
Line     Link Here 
 Lines 1264-1279   const PRInt32 nsCSSProps::kTransitionTim Link Here 
1264
  eCSSKeyword_ease_in_out, NS_STYLE_TRANSITION_TIMING_FUNCTION_EASE_IN_OUT,
1264
  eCSSKeyword_ease_in_out, NS_STYLE_TRANSITION_TIMING_FUNCTION_EASE_IN_OUT,
1265
  eCSSKeyword_UNKNOWN,-1
1265
  eCSSKeyword_UNKNOWN,-1
1266
};
1266
};
1267
1267
1268
const PRInt32 nsCSSProps::kUnicodeBidiKTable[] = {
1268
const PRInt32 nsCSSProps::kUnicodeBidiKTable[] = {
1269
  eCSSKeyword_normal, NS_STYLE_UNICODE_BIDI_NORMAL,
1269
  eCSSKeyword_normal, NS_STYLE_UNICODE_BIDI_NORMAL,
1270
  eCSSKeyword_embed, NS_STYLE_UNICODE_BIDI_EMBED,
1270
  eCSSKeyword_embed, NS_STYLE_UNICODE_BIDI_EMBED,
1271
  eCSSKeyword_bidi_override, NS_STYLE_UNICODE_BIDI_OVERRIDE,
1271
  eCSSKeyword_bidi_override, NS_STYLE_UNICODE_BIDI_OVERRIDE,
1272
  eCSSKeyword__moz_isolate, NS_STYLE_UNICODE_BIDI_MOZ_ISOLATE,
1273
  eCSSKeyword__moz_plaintext, NS_STYLE_UNICODE_BIDI_MOZ_PLAINTEXT,
1272
  eCSSKeyword_UNKNOWN,-1
1274
  eCSSKeyword_UNKNOWN,-1
1273
};
1275
};
1274
1276
1275
const PRInt32 nsCSSProps::kUserFocusKTable[] = {
1277
const PRInt32 nsCSSProps::kUserFocusKTable[] = {
1276
  eCSSKeyword_none,           NS_STYLE_USER_FOCUS_NONE,
1278
  eCSSKeyword_none,           NS_STYLE_USER_FOCUS_NONE,
1277
  eCSSKeyword_normal,         NS_STYLE_USER_FOCUS_NORMAL,
1279
  eCSSKeyword_normal,         NS_STYLE_USER_FOCUS_NORMAL,
1278
  eCSSKeyword_ignore,         NS_STYLE_USER_FOCUS_IGNORE,
1280
  eCSSKeyword_ignore,         NS_STYLE_USER_FOCUS_IGNORE,
1279
  eCSSKeyword_select_all,     NS_STYLE_USER_FOCUS_SELECT_ALL,
1281
  eCSSKeyword_select_all,     NS_STYLE_USER_FOCUS_SELECT_ALL,
(-)a/layout/style/nsCSSValue.cpp (+13 lines)
Line     Link Here 
 Lines 805-820   nsCSSValue::AppendToString(nsCSSProperty Link Here 
805
                           aResult);
805
                           aResult);
806
      } else {
806
      } else {
807
        nsStyleUtil::AppendBitmaskCSSValue(aProperty, intValue,
807
        nsStyleUtil::AppendBitmaskCSSValue(aProperty, intValue,
808
                                           NS_STYLE_PAGE_MARKS_CROP,
808
                                           NS_STYLE_PAGE_MARKS_CROP,
809
                                           NS_STYLE_PAGE_MARKS_REGISTER,
809
                                           NS_STYLE_PAGE_MARKS_REGISTER,
810
                                           aResult);
810
                                           aResult);
811
      }
811
      }
812
    }
812
    }
813
    else if (eCSSProperty_unicode_bidi == aProperty) {
814
      PRInt32 intValue = GetIntValue();
815
      if (NS_STYLE_UNICODE_BIDI_NORMAL == intValue) {
816
        AppendASCIItoUTF16(nsCSSProps::LookupPropertyValue(aProperty, intValue),
817
                           aResult);
818
      } else {
819
        nsStyleUtil::AppendBitmaskCSSValue(
820
          aProperty, intValue,
821
          NS_STYLE_UNICODE_BIDI_EMBED,
822
          NS_STYLE_UNICODE_BIDI_MOZ_PLAINTEXT,
823
          aResult);
824
      }
825
    }
813
    else {
826
    else {
814
      const nsAFlatCString& name = nsCSSProps::LookupPropertyValue(aProperty, GetIntValue());
827
      const nsAFlatCString& name = nsCSSProps::LookupPropertyValue(aProperty, GetIntValue());
815
      AppendASCIItoUTF16(name, aResult);
828
      AppendASCIItoUTF16(name, aResult);
816
    }
829
    }
817
  }
830
  }
818
  else if (eCSSUnit_EnumColor == unit) {
831
  else if (eCSSUnit_EnumColor == unit) {
819
    // we can lookup the property in the ColorTable and then
832
    // we can lookup the property in the ColorTable and then
820
    // get a string mapping the name
833
    // get a string mapping the name
(-)a/layout/style/nsComputedDOMStyle.cpp (-3 / +13 lines)
Line     Link Here 
 Lines 2423-2441   nsComputedDOMStyle::DoGetDirection() Link Here 
2423
                                   nsCSSProps::kDirectionKTable));
2423
                                   nsCSSProps::kDirectionKTable));
2424
  return val;
2424
  return val;
2425
}
2425
}
2426
2426
2427
nsIDOMCSSValue*
2427
nsIDOMCSSValue*
2428
nsComputedDOMStyle::DoGetUnicodeBidi()
2428
nsComputedDOMStyle::DoGetUnicodeBidi()
2429
{
2429
{
2430
  nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
2430
  nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
2431
  val->SetIdent(
2431
  PRInt32 intValue = GetStyleTextReset()->mUnicodeBidi;
2432
    nsCSSProps::ValueToKeywordEnum(GetStyleTextReset()->mUnicodeBidi,
2432
2433
                                   nsCSSProps::kUnicodeBidiKTable));
2433
  if (NS_STYLE_UNICODE_BIDI_NORMAL == intValue) {
2434
    val->SetIdent(eCSSKeyword_normal);
2435
  } else {
2436
    nsAutoString unicodeBidiString;
2437
    nsStyleUtil::AppendBitmaskCSSValue(eCSSProperty_unicode_bidi, intValue,
2438
                                       NS_STYLE_UNICODE_BIDI_EMBED,
2439
                                       NS_STYLE_UNICODE_BIDI_MOZ_PLAINTEXT,
2440
                                       unicodeBidiString);
2441
    val->SetString(unicodeBidiString);
2442
  }
2443
2434
  return val;
2444
  return val;
2435
}
2445
}
2436
2446
2437
nsIDOMCSSValue*
2447
nsIDOMCSSValue*
2438
nsComputedDOMStyle::DoGetCursor()
2448
nsComputedDOMStyle::DoGetCursor()
2439
{
2449
{
2440
  nsDOMCSSValueList *valueList = GetROCSSValueList(PR_TRUE);
2450
  nsDOMCSSValueList *valueList = GetROCSSValueList(PR_TRUE);
2441
2451
(-)a/layout/style/test/property_database.js (-2 / +2 lines)
Line     Link Here 
 Lines 2644-2661   var gCSSProperties = { Link Here 
2644
		other_values: [ "linear", "ease-in", "ease-out", "ease-in-out", "linear, ease-in, cubic-bezier(0.1, 0.2, 0.8, 0.9)", "cubic-bezier(0.5, 0.5, 0.5, 0.5)", "cubic-bezier(0.25, 1.5, 0.75, -0.5)" ],
2644
		other_values: [ "linear", "ease-in", "ease-out", "ease-in-out", "linear, ease-in, cubic-bezier(0.1, 0.2, 0.8, 0.9)", "cubic-bezier(0.5, 0.5, 0.5, 0.5)", "cubic-bezier(0.25, 1.5, 0.75, -0.5)" ],
2645
		invalid_values: [ "none", "auto", "cubic-bezier(0.25, 0.1, 0.25)", "cubic-bezier(0.25, 0.1, 0.25, 0.25, 1.0)", "cubic-bezier(-0.5, 0.5, 0.5, 0.5)", "cubic-bezier(1.5, 0.5, 0.5, 0.5)", "cubic-bezier(0.5, 0.5, -0.5, 0.5)", "cubic-bezier(0.5, 0.5, 1.5, 0.5)" ]
2645
		invalid_values: [ "none", "auto", "cubic-bezier(0.25, 0.1, 0.25)", "cubic-bezier(0.25, 0.1, 0.25, 0.25, 1.0)", "cubic-bezier(-0.5, 0.5, 0.5, 0.5)", "cubic-bezier(1.5, 0.5, 0.5, 0.5)", "cubic-bezier(0.5, 0.5, -0.5, 0.5)", "cubic-bezier(0.5, 0.5, 1.5, 0.5)" ]
2646
	},
2646
	},
2647
	"unicode-bidi": {
2647
	"unicode-bidi": {
2648
		domProp: "unicodeBidi",
2648
		domProp: "unicodeBidi",
2649
		inherited: false,
2649
		inherited: false,
2650
		type: CSS_TYPE_LONGHAND,
2650
		type: CSS_TYPE_LONGHAND,
2651
		initial_values: [ "normal" ],
2651
		initial_values: [ "normal" ],
2652
		other_values: [ "embed", "bidi-override" ],
2652
		other_values: [ "embed", "bidi-override", "-moz-isolate", "-moz-plaintext", "-moz-isolate bidi-override", "-moz-plaintext embed" ],
2653
		invalid_values: [ "auto", "none" ]
2653
		invalid_values: [ "auto", "none", "normal embed", "normal bidi-override", "embed -moz-isolate", "bidi-override -moz-plaintext", "-moz-isolate embed", "embed normal" ]
2654
	},
2654
	},
2655
	"vertical-align": {
2655
	"vertical-align": {
2656
		domProp: "verticalAlign",
2656
		domProp: "verticalAlign",
2657
		inherited: false,
2657
		inherited: false,
2658
		type: CSS_TYPE_LONGHAND,
2658
		type: CSS_TYPE_LONGHAND,
2659
		initial_values: [ "baseline" ],
2659
		initial_values: [ "baseline" ],
2660
		other_values: [ "sub", "super", "top", "text-top", "middle", "bottom", "text-bottom", "15%", "3px", "0.2em", "-5px", "-3%",
2660
		other_values: [ "sub", "super", "top", "text-top", "middle", "bottom", "text-bottom", "15%", "3px", "0.2em", "-5px", "-3%",
2661
			"-moz-calc(2px)",
2661
			"-moz-calc(2px)",
(-)a/layout/svg/base/src/nsSVGGlyphFrame.cpp (-1 / +1 lines)
Line     Link Here 
 Lines 1555-1571   nsSVGGlyphFrame::EnsureTextRun(float *aD Link Here 
1555
     * new text chunk, so we always set the base direction according to the
1555
     * new text chunk, so we always set the base direction according to the
1556
     * direction property
1556
     * direction property
1557
     *
1557
     *
1558
     * See also XXXsmontagu comments in nsSVGTextFrame::UpdateGlyphPositioning
1558
     * See also XXXsmontagu comments in nsSVGTextFrame::UpdateGlyphPositioning
1559
     */
1559
     */
1560
    
1560
    
1561
    // Get the unicodeBidi property from the parent, because it doesn't
1561
    // Get the unicodeBidi property from the parent, because it doesn't
1562
    // inherit
1562
    // inherit
1563
    PRBool bidiOverride = (mParent->GetStyleTextReset()->mUnicodeBidi ==
1563
    PRBool bidiOverride = (mParent->GetStyleTextReset()->mUnicodeBidi &
1564
                           NS_STYLE_UNICODE_BIDI_OVERRIDE);
1564
                           NS_STYLE_UNICODE_BIDI_OVERRIDE);
1565
    nsBidiLevel baseDirection =
1565
    nsBidiLevel baseDirection =
1566
      GetStyleVisibility()->mDirection == NS_STYLE_DIRECTION_RTL ?
1566
      GetStyleVisibility()->mDirection == NS_STYLE_DIRECTION_RTL ?
1567
        NSBIDI_RTL : NSBIDI_LTR;
1567
        NSBIDI_RTL : NSBIDI_LTR;
1568
    nsBidiPresUtils::CopyLogicalToVisual(text, visualText,
1568
    nsBidiPresUtils::CopyLogicalToVisual(text, visualText,
1569
                                         baseDirection, bidiOverride);
1569
                                         baseDirection, bidiOverride);
1570
    if (!visualText.IsEmpty()) {
1570
    if (!visualText.IsEmpty()) {
1571
      text = visualText;
1571
      text = visualText;

Return to bug 613149