- Source/WebCore/ChangeLog +54 lines
Lines 1-3 Source/WebCore/ChangeLog_sec1
1
2012-11-28  Dan Bernstein  <mitz@apple.com>
2
3
        <rdar://problem/12771885> Support ruby-position: {before, after}
4
        https://bugs.webkit.org/show_bug.cgi?id=103569
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Specified in <http://www.w3.org/TR/2011/WD-css3-ruby-20110630/#rubypos>, the ruby-position
9
        property takes four values: before, after, inter-character, and inline. This change adds
10
        support for the values before and after.
11
12
        Test: fast/ruby/position-after.html
13
14
        * css/CSSComputedStyleDeclaration.cpp:
15
        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Handle ruby-position.
16
        * css/CSSParser.cpp:
17
        (WebCore::isValidKeywordPropertyAndValue): Accept before and after as valid values for
18
        ruby-position.
19
        (WebCore::isKeywordPropertyID): Added ruby-position to the list of properties with keyword
20
        values.
21
        (WebCore::CSSParser::parseValue): Added ruby-position to the switch statement.
22
        * css/CSSPrimitiveValueMappings.h:
23
        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Added mapping from RubyPosition.
24
        (WebCore::CSSPrimitiveValue::operator RubyPosition): Added mapping from CSSPrimitiveValue.
25
        * css/CSSProperty.cpp:
26
        (WebCore::CSSProperty::isInheritedProperty): Added ruby-position as an inherited property.
27
        * css/CSSPropertyNames.in: Added -webkit-ruby-position.
28
        * css/CSSValueKeywords.in: Added after and before.
29
        * css/StyleBuilder.cpp:
30
        (WebCore::StyleBuilder::StyleBuilder): Added a handler for ruby-position.
31
        * css/StyleResolver.cpp:
32
        (WebCore::StyleResolver::applyProperty): Added ruby-position.
33
        * rendering/InlineFlowBox.cpp:
34
        (WebCore::InlineFlowBox::placeBoxesInBlockDirection): Changed to choose which of
35
        hasAnnotationsBefore and hasAnnotationsAfter to set based on ruby position.
36
        (WebCore::InlineFlowBox::computeOverAnnotationAdjustment): Changed to adjust only for
37
        ruby positioned before the base.
38
        (WebCore::InlineFlowBox::computeUnderAnnotationAdjustment): Added adjustment for ruby
39
        positioned after the base.
40
        * rendering/RenderRubyRun.cpp:
41
        (WebCore::RenderRubyRun::layout): Account for ruby-position when positioning the ruby text
42
        relative to the base.
43
        * rendering/style/RenderStyle.cpp:
44
        (WebCore::RenderStyle::diff): Made a ruby-position difference a layout difference.
45
        * rendering/style/RenderStyle.h: Added rubyPosition(), setRubyPosition(), and 
46
        initialRubyPosition().
47
        * rendering/style/RenderStyleConstants.h: Added the RubyPosition enum.
48
        * rendering/style/StyleRareInheritedData.cpp:
49
        (WebCore::StyleRareInheritedData::StyleRareInheritedData): Added initialized for
50
        m_rubyPosition. Added copying the value of this member to the copy constructor.
51
        (WebCore::StyleRareInheritedData::operator==): Added comparison of m_rubyPosition.
52
        * rendering/style/StyleRareInheritedData.h:
53
        (StyleRareInheritedData): Added m_rubyPosition member variable.
54
1
2012-11-28  Michael Saboff  <msaboff@apple.com>
55
2012-11-28  Michael Saboff  <msaboff@apple.com>
2
56
3
        HTMLFontElement font size parsing should directly handle 8 bit strings
57
        HTMLFontElement font size parsing should directly handle 8 bit strings
- Source/WebCore/css/CSSComputedStyleDeclaration.cpp +2 lines
Lines 2029-2034 PassRefPtr<CSSValue> CSSComputedStyleDec Source/WebCore/css/CSSComputedStyleDeclaration.cpp_sec1
2029
            return cssValuePool().createValue(style->position());
2029
            return cssValuePool().createValue(style->position());
2030
        case CSSPropertyRight:
2030
        case CSSPropertyRight:
2031
            return getPositionOffsetValue(style.get(), CSSPropertyRight, m_node->document()->renderView());
2031
            return getPositionOffsetValue(style.get(), CSSPropertyRight, m_node->document()->renderView());
2032
        case CSSPropertyWebkitRubyPosition:
2033
            return cssValuePool().createValue(style->rubyPosition());
2032
        case CSSPropertyTableLayout:
2034
        case CSSPropertyTableLayout:
2033
            return cssValuePool().createValue(style->tableLayout());
2035
            return cssValuePool().createValue(style->tableLayout());
2034
        case CSSPropertyTextAlign:
2036
        case CSSPropertyTextAlign:
- Source/WebCore/css/CSSParser.cpp +8 lines
Lines 890-895 static inline bool isValidKeywordPropert Source/WebCore/css/CSSParser.cpp_sec1
890
        if (valueID == CSSValueLogical || valueID == CSSValueVisual)
890
        if (valueID == CSSValueLogical || valueID == CSSValueVisual)
891
            return true;
891
            return true;
892
        break;
892
        break;
893
894
    case CSSPropertyWebkitRubyPosition:
895
        if (valueID == CSSValueBefore || valueID == CSSValueAfter)
896
            return true;
897
        break;
898
893
#if ENABLE(CSS3_TEXT)
899
#if ENABLE(CSS3_TEXT)
894
    case CSSPropertyWebkitTextAlignLast:
900
    case CSSPropertyWebkitTextAlignLast:
895
        // auto | start | end | left | right | center | justify
901
        // auto | start | end | left | right | center | justify
Lines 1057-1062 static inline bool isKeywordPropertyID(C Source/WebCore/css/CSSParser.cpp_sec2
1057
    case CSSPropertyWebkitRegionOverflow:
1063
    case CSSPropertyWebkitRegionOverflow:
1058
#endif
1064
#endif
1059
    case CSSPropertyWebkitRtlOrdering:
1065
    case CSSPropertyWebkitRtlOrdering:
1066
    case CSSPropertyWebkitRubyPosition:
1060
#if ENABLE(CSS3_TEXT)
1067
#if ENABLE(CSS3_TEXT)
1061
    case CSSPropertyWebkitTextAlignLast:
1068
    case CSSPropertyWebkitTextAlignLast:
1062
#endif // CSS3_TEXT
1069
#endif // CSS3_TEXT
Lines 2875-2880 bool CSSParser::parseValue(CSSPropertyID Source/WebCore/css/CSSParser.cpp_sec3
2875
    case CSSPropertyWebkitRegionOverflow:
2882
    case CSSPropertyWebkitRegionOverflow:
2876
#endif
2883
#endif
2877
    case CSSPropertyWebkitRtlOrdering:
2884
    case CSSPropertyWebkitRtlOrdering:
2885
    case CSSPropertyWebkitRubyPosition:
2878
#if ENABLE(CSS3_TEXT)
2886
#if ENABLE(CSS3_TEXT)
2879
    case CSSPropertyWebkitTextAlignLast:
2887
    case CSSPropertyWebkitTextAlignLast:
2880
#endif // CSS3_TEXT
2888
#endif // CSS3_TEXT
- Source/WebCore/css/CSSPrimitiveValueMappings.h +27 lines
Lines 2805-2810 template<> inline CSSPrimitiveValue::ope Source/WebCore/css/CSSPrimitiveValueMappings.h_sec1
2805
    return TextCombineNone;
2805
    return TextCombineNone;
2806
}
2806
}
2807
2807
2808
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(RubyPosition position)
2809
    : CSSValue(PrimitiveClass)
2810
{
2811
    m_primitiveUnitType = CSS_IDENT;
2812
    switch (position) {
2813
    case RubyPositionBefore:
2814
        m_value.ident = CSSValueBefore;
2815
        break;
2816
    case RubyPositionAfter:
2817
        m_value.ident = CSSValueAfter;
2818
        break;
2819
    }
2820
}
2821
2822
template<> inline CSSPrimitiveValue::operator RubyPosition() const
2823
{
2824
    switch (m_value.ident) {
2825
    case CSSValueBefore:
2826
        return RubyPositionBefore;
2827
    case CSSValueAfter:
2828
        return RubyPositionAfter;
2829
    }
2830
2831
    ASSERT_NOT_REACHED();
2832
    return RubyPositionBefore;
2833
}
2834
2808
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextEmphasisPosition position)
2835
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextEmphasisPosition position)
2809
    : CSSValue(PrimitiveClass)
2836
    : CSSValue(PrimitiveClass)
2810
{
2837
{
- Source/WebCore/css/CSSProperty.cpp +1 lines
Lines 324-329 bool CSSProperty::isInheritedProperty(CS Source/WebCore/css/CSSProperty.cpp_sec1
324
#endif
324
#endif
325
    case CSSPropertyWebkitPrintColorAdjust:
325
    case CSSPropertyWebkitPrintColorAdjust:
326
    case CSSPropertyWebkitRtlOrdering:
326
    case CSSPropertyWebkitRtlOrdering:
327
    case CSSPropertyWebkitRubyPosition:
327
    case CSSPropertyWebkitTextCombine:
328
    case CSSPropertyWebkitTextCombine:
328
#if ENABLE(CSS3_TEXT)
329
#if ENABLE(CSS3_TEXT)
329
    case CSSPropertyWebkitTextDecorationLine:
330
    case CSSPropertyWebkitTextDecorationLine:
- Source/WebCore/css/CSSPropertyNames.in +1 lines
Lines 352-357 z-index Source/WebCore/css/CSSPropertyNames.in_sec1
352
-webkit-perspective-origin-y
352
-webkit-perspective-origin-y
353
-webkit-print-color-adjust
353
-webkit-print-color-adjust
354
-webkit-rtl-ordering
354
-webkit-rtl-ordering
355
-webkit-ruby-position
355
-webkit-text-combine
356
-webkit-text-combine
356
-epub-text-combine = -webkit-text-combine
357
-epub-text-combine = -webkit-text-combine
357
#if defined(ENABLE_CSS3_TEXT) && ENABLE_CSS3_TEXT
358
#if defined(ENABLE_CSS3_TEXT) && ENABLE_CSS3_TEXT
- Source/WebCore/css/CSSValueKeywords.in +4 lines
Lines 871-876 vertical-rl Source/WebCore/css/CSSValueKeywords.in_sec1
871
vertical-lr
871
vertical-lr
872
horizontal-bt
872
horizontal-bt
873
873
874
// -webkit-ruby-position
875
after
876
before
877
874
// -webkit-text-emphasis-position
878
// -webkit-text-emphasis-position
875
over
879
over
876
under
880
under
- Source/WebCore/css/StyleBuilder.cpp +1 lines
Lines 2051-2056 StyleBuilder::StyleBuilder() Source/WebCore/css/StyleBuilder.cpp_sec1
2051
    setPropertyHandler(CSSPropertyWebkitRegionOverflow, ApplyPropertyDefault<RegionOverflow, &RenderStyle::regionOverflow, RegionOverflow, &RenderStyle::setRegionOverflow, RegionOverflow, &RenderStyle::initialRegionOverflow>::createHandler());
2051
    setPropertyHandler(CSSPropertyWebkitRegionOverflow, ApplyPropertyDefault<RegionOverflow, &RenderStyle::regionOverflow, RegionOverflow, &RenderStyle::setRegionOverflow, RegionOverflow, &RenderStyle::initialRegionOverflow>::createHandler());
2052
#endif
2052
#endif
2053
    setPropertyHandler(CSSPropertyWebkitRtlOrdering, ApplyPropertyDefault<Order, &RenderStyle::rtlOrdering, Order, &RenderStyle::setRTLOrdering, Order, &RenderStyle::initialRTLOrdering>::createHandler());
2053
    setPropertyHandler(CSSPropertyWebkitRtlOrdering, ApplyPropertyDefault<Order, &RenderStyle::rtlOrdering, Order, &RenderStyle::setRTLOrdering, Order, &RenderStyle::initialRTLOrdering>::createHandler());
2054
    setPropertyHandler(CSSPropertyWebkitRubyPosition, ApplyPropertyDefault<RubyPosition, &RenderStyle::rubyPosition, RubyPosition, &RenderStyle::setRubyPosition, RubyPosition, &RenderStyle::initialRubyPosition>::createHandler());
2054
    setPropertyHandler(CSSPropertyWebkitTextCombine, ApplyPropertyDefault<TextCombine, &RenderStyle::textCombine, TextCombine, &RenderStyle::setTextCombine, TextCombine, &RenderStyle::initialTextCombine>::createHandler());
2055
    setPropertyHandler(CSSPropertyWebkitTextCombine, ApplyPropertyDefault<TextCombine, &RenderStyle::textCombine, TextCombine, &RenderStyle::setTextCombine, TextCombine, &RenderStyle::initialTextCombine>::createHandler());
2055
    setPropertyHandler(CSSPropertyWebkitTextEmphasisColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::textEmphasisColor, &RenderStyle::setTextEmphasisColor, &RenderStyle::setVisitedLinkTextEmphasisColor, &RenderStyle::color>::createHandler());
2056
    setPropertyHandler(CSSPropertyWebkitTextEmphasisColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::textEmphasisColor, &RenderStyle::setTextEmphasisColor, &RenderStyle::setVisitedLinkTextEmphasisColor, &RenderStyle::color>::createHandler());
2056
    setPropertyHandler(CSSPropertyWebkitTextEmphasisPosition, ApplyPropertyDefault<TextEmphasisPosition, &RenderStyle::textEmphasisPosition, TextEmphasisPosition, &RenderStyle::setTextEmphasisPosition, TextEmphasisPosition, &RenderStyle::initialTextEmphasisPosition>::createHandler());
2057
    setPropertyHandler(CSSPropertyWebkitTextEmphasisPosition, ApplyPropertyDefault<TextEmphasisPosition, &RenderStyle::textEmphasisPosition, TextEmphasisPosition, &RenderStyle::setTextEmphasisPosition, TextEmphasisPosition, &RenderStyle::initialTextEmphasisPosition>::createHandler());
- Source/WebCore/css/StyleResolver.cpp +1 lines
Lines 3806-3811 void StyleResolver::applyProperty(CSSPro Source/WebCore/css/StyleResolver.cpp_sec1
3806
    case CSSPropertyWebkitRegionOverflow:
3806
    case CSSPropertyWebkitRegionOverflow:
3807
#endif
3807
#endif
3808
    case CSSPropertyWebkitRtlOrdering:
3808
    case CSSPropertyWebkitRtlOrdering:
3809
    case CSSPropertyWebkitRubyPosition:
3809
    case CSSPropertyWebkitTextCombine:
3810
    case CSSPropertyWebkitTextCombine:
3810
#if ENABLE(CSS3_TEXT)
3811
#if ENABLE(CSS3_TEXT)
3811
    case CSSPropertyWebkitTextDecorationLine:
3812
    case CSSPropertyWebkitTextDecorationLine:
- Source/WebCore/rendering/InlineFlowBox.cpp -2 / +23 lines
Lines 670-676 void InlineFlowBox::placeBoxesInBlockDir Source/WebCore/rendering/InlineFlowBox.cpp_sec1
670
                // Treat the leading on the first and last lines of ruby runs as not being part of the overall lineTop/lineBottom.
670
                // Treat the leading on the first and last lines of ruby runs as not being part of the overall lineTop/lineBottom.
671
                // Really this is a workaround hack for the fact that ruby should have been done as line layout and not done using
671
                // Really this is a workaround hack for the fact that ruby should have been done as line layout and not done using
672
                // inline-block.
672
                // inline-block.
673
                if (!renderer()->style()->isFlippedLinesWritingMode())
673
                if (renderer()->style()->isFlippedLinesWritingMode() == (curr->renderer()->style()->rubyPosition() == RubyPositionAfter))
674
                    hasAnnotationsBefore = true;
674
                    hasAnnotationsBefore = true;
675
                else
675
                else
676
                    hasAnnotationsAfter = true;
676
                    hasAnnotationsAfter = true;
Lines 1461-1467 LayoutUnit InlineFlowBox::computeOverAnn Source/WebCore/rendering/InlineFlowBox.cpp_sec2
1461
        if (curr->isInlineFlowBox())
1461
        if (curr->isInlineFlowBox())
1462
            result = max(result, toInlineFlowBox(curr)->computeOverAnnotationAdjustment(allowedPosition));
1462
            result = max(result, toInlineFlowBox(curr)->computeOverAnnotationAdjustment(allowedPosition));
1463
        
1463
        
1464
        if (curr->renderer()->isReplaced() && curr->renderer()->isRubyRun()) {
1464
        if (curr->renderer()->isReplaced() && curr->renderer()->isRubyRun() && curr->renderer()->style()->rubyPosition() == RubyPositionBefore) {
1465
            RenderRubyRun* rubyRun = toRenderRubyRun(curr->renderer());
1465
            RenderRubyRun* rubyRun = toRenderRubyRun(curr->renderer());
1466
            RenderRubyText* rubyText = rubyRun->rubyText();
1466
            RenderRubyText* rubyText = rubyRun->rubyText();
1467
            if (!rubyText)
1467
            if (!rubyText)
Lines 1509-1514 LayoutUnit InlineFlowBox::computeUnderAn Source/WebCore/rendering/InlineFlowBox.cpp_sec3
1509
        if (curr->isInlineFlowBox())
1509
        if (curr->isInlineFlowBox())
1510
            result = max(result, toInlineFlowBox(curr)->computeUnderAnnotationAdjustment(allowedPosition));
1510
            result = max(result, toInlineFlowBox(curr)->computeUnderAnnotationAdjustment(allowedPosition));
1511
1511
1512
        if (curr->renderer()->isReplaced() && curr->renderer()->isRubyRun() && curr->renderer()->style()->rubyPosition() == RubyPositionAfter) {
1513
            RenderRubyRun* rubyRun = toRenderRubyRun(curr->renderer());
1514
            RenderRubyText* rubyText = rubyRun->rubyText();
1515
            if (!rubyText)
1516
                continue;
1517
1518
            if (rubyRun->style()->isFlippedLinesWritingMode()) {
1519
                LayoutUnit topOfFirstRubyTextLine = rubyText->logicalTop() + (rubyText->firstRootBox() ? rubyText->firstRootBox()->lineTop() : LayoutUnit());
1520
                if (topOfFirstRubyTextLine >= 0)
1521
                    continue;
1522
                topOfFirstRubyTextLine += curr->logicalTop();
1523
                result = max(result, allowedPosition - topOfFirstRubyTextLine);
1524
            } else {
1525
                LayoutUnit bottomOfLastRubyTextLine = rubyText->logicalTop() + (rubyText->lastRootBox() ? rubyText->lastRootBox()->lineBottom() : rubyText->logicalHeight());
1526
                if (bottomOfLastRubyTextLine <= curr->logicalHeight())
1527
                    continue;
1528
                bottomOfLastRubyTextLine += curr->logicalTop();
1529
                result = max(result, bottomOfLastRubyTextLine - allowedPosition);
1530
            }
1531
        }
1532
1512
        if (curr->isInlineTextBox()) {
1533
        if (curr->isInlineTextBox()) {
1513
            RenderStyle* style = curr->renderer()->style(isFirstLineStyle());
1534
            RenderStyle* style = curr->renderer()->style(isFirstLineStyle());
1514
            if (style->textEmphasisMark() != TextEmphasisMarkNone && style->textEmphasisPosition() == TextEmphasisPositionUnder) {
1535
            if (style->textEmphasisMark() != TextEmphasisMarkNone && style->textEmphasisPosition() == TextEmphasisPositionUnder) {
- Source/WebCore/rendering/RenderRubyRun.cpp -1 / +1 lines
Lines 246-252 void RenderRubyRun::layout() Source/WebCore/rendering/RenderRubyRun.cpp_sec1
246
        lastLineRubyTextBottom = rootBox->logicalBottomLayoutOverflow();
246
        lastLineRubyTextBottom = rootBox->logicalBottomLayoutOverflow();
247
    }
247
    }
248
248
249
    if (!style()->isFlippedLinesWritingMode()) {
249
    if (style()->isFlippedLinesWritingMode() == (style()->rubyPosition() == RubyPositionAfter)) {
250
        LayoutUnit firstLineTop = 0;
250
        LayoutUnit firstLineTop = 0;
251
        if (RenderRubyBase* rb = rubyBase()) {
251
        if (RenderRubyBase* rb = rubyBase()) {
252
            RootInlineBox* rootBox = rb->firstRootBox();
252
            RootInlineBox* rootBox = rb->firstRootBox();
- Source/WebCore/rendering/style/RenderStyle.cpp +1 lines
Lines 478-483 StyleDifference RenderStyle::diff(const Source/WebCore/rendering/style/RenderStyle.cpp_sec1
478
            || rareInheritedData->hyphenationLimitAfter != other->rareInheritedData->hyphenationLimitAfter
478
            || rareInheritedData->hyphenationLimitAfter != other->rareInheritedData->hyphenationLimitAfter
479
            || rareInheritedData->hyphenationString != other->rareInheritedData->hyphenationString
479
            || rareInheritedData->hyphenationString != other->rareInheritedData->hyphenationString
480
            || rareInheritedData->locale != other->rareInheritedData->locale
480
            || rareInheritedData->locale != other->rareInheritedData->locale
481
            || rareInheritedData->m_rubyPosition != other->rareInheritedData->m_rubyPosition
481
            || rareInheritedData->textEmphasisMark != other->rareInheritedData->textEmphasisMark
482
            || rareInheritedData->textEmphasisMark != other->rareInheritedData->textEmphasisMark
482
            || rareInheritedData->textEmphasisPosition != other->rareInheritedData->textEmphasisPosition
483
            || rareInheritedData->textEmphasisPosition != other->rareInheritedData->textEmphasisPosition
483
            || rareInheritedData->textEmphasisCustomMark != other->rareInheritedData->textEmphasisCustomMark
484
            || rareInheritedData->textEmphasisCustomMark != other->rareInheritedData->textEmphasisCustomMark
- Source/WebCore/rendering/style/RenderStyle.h -1 / +6 lines
Lines 836-842 public: Source/WebCore/rendering/style/RenderStyle.h_sec1
836
    const AtomicString& textEmphasisCustomMark() const { return rareInheritedData->textEmphasisCustomMark; }
836
    const AtomicString& textEmphasisCustomMark() const { return rareInheritedData->textEmphasisCustomMark; }
837
    TextEmphasisPosition textEmphasisPosition() const { return static_cast<TextEmphasisPosition>(rareInheritedData->textEmphasisPosition); }
837
    TextEmphasisPosition textEmphasisPosition() const { return static_cast<TextEmphasisPosition>(rareInheritedData->textEmphasisPosition); }
838
    const AtomicString& textEmphasisMarkString() const;
838
    const AtomicString& textEmphasisMarkString() const;
839
    
839
840
    RubyPosition rubyPosition() const { return static_cast<RubyPosition>(rareInheritedData->m_rubyPosition); }
841
840
    // Return true if any transform related property (currently transform, transformStyle3D or perspective) 
842
    // Return true if any transform related property (currently transform, transformStyle3D or perspective) 
841
    // indicates that we are transforming
843
    // indicates that we are transforming
842
    bool hasTransformRelatedProperty() const { return hasTransform() || preserves3D() || hasPerspective(); }
844
    bool hasTransformRelatedProperty() const { return hasTransform() || preserves3D() || hasPerspective(); }
Lines 1301-1306 public: Source/WebCore/rendering/style/RenderStyle.h_sec2
1301
    void setTextEmphasisCustomMark(const AtomicString& mark) { SET_VAR(rareInheritedData, textEmphasisCustomMark, mark); }
1303
    void setTextEmphasisCustomMark(const AtomicString& mark) { SET_VAR(rareInheritedData, textEmphasisCustomMark, mark); }
1302
    void setTextEmphasisPosition(TextEmphasisPosition position) { SET_VAR(rareInheritedData, textEmphasisPosition, position); }
1304
    void setTextEmphasisPosition(TextEmphasisPosition position) { SET_VAR(rareInheritedData, textEmphasisPosition, position); }
1303
1305
1306
    void setRubyPosition(RubyPosition position) { SET_VAR(rareInheritedData, m_rubyPosition, position); }
1307
1304
#if ENABLE(CSS_FILTERS)
1308
#if ENABLE(CSS_FILTERS)
1305
    void setFilter(const FilterOperations& ops) { SET_VAR(rareNonInheritedData.access()->m_filter, m_operations, ops); }
1309
    void setFilter(const FilterOperations& ops) { SET_VAR(rareNonInheritedData.access()->m_filter, m_operations, ops); }
1306
#endif
1310
#endif
Lines 1617-1622 public: Source/WebCore/rendering/style/RenderStyle.h_sec3
1617
    static TextEmphasisMark initialTextEmphasisMark() { return TextEmphasisMarkNone; }
1621
    static TextEmphasisMark initialTextEmphasisMark() { return TextEmphasisMarkNone; }
1618
    static const AtomicString& initialTextEmphasisCustomMark() { return nullAtom; }
1622
    static const AtomicString& initialTextEmphasisCustomMark() { return nullAtom; }
1619
    static TextEmphasisPosition initialTextEmphasisPosition() { return TextEmphasisPositionOver; }
1623
    static TextEmphasisPosition initialTextEmphasisPosition() { return TextEmphasisPositionOver; }
1624
    static RubyPosition initialRubyPosition() { return RubyPositionBefore; }
1620
    static LineBoxContain initialLineBoxContain() { return LineBoxContainBlock | LineBoxContainInline | LineBoxContainReplaced; }
1625
    static LineBoxContain initialLineBoxContain() { return LineBoxContainBlock | LineBoxContainInline | LineBoxContainReplaced; }
1621
    static ImageOrientationEnum initialImageOrientation() { return OriginTopLeft; }
1626
    static ImageOrientationEnum initialImageOrientation() { return OriginTopLeft; }
1622
    static EImageRendering initialImageRendering() { return ImageRenderingAuto; }
1627
    static EImageRendering initialImageRendering() { return ImageRenderingAuto; }
- Source/WebCore/rendering/style/RenderStyleConstants.h +2 lines
Lines 475-480 enum WrapFlow { WrapFlowAuto, WrapFlowBo Source/WebCore/rendering/style/RenderStyleConstants.h_sec1
475
475
476
enum WrapThrough { WrapThroughWrap, WrapThroughNone };
476
enum WrapThrough { WrapThroughWrap, WrapThroughNone };
477
477
478
enum RubyPosition { RubyPositionBefore, RubyPositionAfter };
479
478
#if ENABLE(DRAGGABLE_REGION)
480
#if ENABLE(DRAGGABLE_REGION)
479
enum DraggableRegionMode { DraggableRegionNone, DraggableRegionDrag, DraggableRegionNoDrag };
481
enum DraggableRegionMode { DraggableRegionNone, DraggableRegionDrag, DraggableRegionNoDrag };
480
#endif
482
#endif
- Source/WebCore/rendering/style/StyleRareInheritedData.cpp +3 lines
Lines 102-107 StyleRareInheritedData::StyleRareInherit Source/WebCore/rendering/style/StyleRareInheritedData.cpp_sec1
102
#if ENABLE(CSS3_TEXT)
102
#if ENABLE(CSS3_TEXT)
103
    , m_textAlignLast(RenderStyle::initialTextAlignLast())
103
    , m_textAlignLast(RenderStyle::initialTextAlignLast())
104
#endif // CSS3_TEXT
104
#endif // CSS3_TEXT
105
    , m_rubyPosition(RenderStyle::initialRubyPosition())
105
    , hyphenationLimitBefore(-1)
106
    , hyphenationLimitBefore(-1)
106
    , hyphenationLimitAfter(-1)
107
    , hyphenationLimitAfter(-1)
107
    , hyphenationLimitLines(-1)
108
    , hyphenationLimitLines(-1)
Lines 168-173 StyleRareInheritedData::StyleRareInherit Source/WebCore/rendering/style/StyleRareInheritedData.cpp_sec2
168
#if ENABLE(CSS3_TEXT)
169
#if ENABLE(CSS3_TEXT)
169
    , m_textAlignLast(o.m_textAlignLast)
170
    , m_textAlignLast(o.m_textAlignLast)
170
#endif // CSS3_TEXT
171
#endif // CSS3_TEXT
172
    , m_rubyPosition(o.m_rubyPosition)
171
    , hyphenationString(o.hyphenationString)
173
    , hyphenationString(o.hyphenationString)
172
    , hyphenationLimitBefore(o.hyphenationLimitBefore)
174
    , hyphenationLimitBefore(o.hyphenationLimitBefore)
173
    , hyphenationLimitAfter(o.hyphenationLimitAfter)
175
    , hyphenationLimitAfter(o.hyphenationLimitAfter)
Lines 260-265 bool StyleRareInheritedData::operator==( Source/WebCore/rendering/style/StyleRareInheritedData.cpp_sec3
260
#if ENABLE(CSS3_TEXT)
262
#if ENABLE(CSS3_TEXT)
261
        && m_textAlignLast == o.m_textAlignLast
263
        && m_textAlignLast == o.m_textAlignLast
262
#endif // CSS3_TEXT
264
#endif // CSS3_TEXT
265
        && m_rubyPosition == o.m_rubyPosition
263
        && m_lineSnap == o.m_lineSnap
266
        && m_lineSnap == o.m_lineSnap
264
#if ENABLE(CSS_VARIABLES)
267
#if ENABLE(CSS_VARIABLES)
265
        && m_variables == o.m_variables
268
        && m_variables == o.m_variables
- Source/WebCore/rendering/style/StyleRareInheritedData.h +1 lines
Lines 116-121 public: Source/WebCore/rendering/style/StyleRareInheritedData.h_sec1
116
#if ENABLE(CSS3_TEXT)
116
#if ENABLE(CSS3_TEXT)
117
    unsigned m_textAlignLast : 3; // ETextAlignLast
117
    unsigned m_textAlignLast : 3; // ETextAlignLast
118
#endif // CSS3_TEXT
118
#endif // CSS3_TEXT
119
    unsigned m_rubyPosition : 1; // RubyPosition
119
120
120
    AtomicString hyphenationString;
121
    AtomicString hyphenationString;
121
    short hyphenationLimitBefore;
122
    short hyphenationLimitBefore;
- LayoutTests/ChangeLog +11 lines
Lines 1-3 LayoutTests/ChangeLog_sec1
1
2012-11-28  Dan Bernstein  <mitz@apple.com>
2
3
        <rdar://problem/12771885> Support ruby-position: {before, after}
4
        https://bugs.webkit.org/show_bug.cgi?id=103569
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        * fast/ruby/position-after-expected.png: Added.
9
        * fast/ruby/position-after-expected.txt: Added.
10
        * fast/ruby/position-after.html: Added.
11
1
2012-11-28  Tom Sepez  <tsepez@chromium.org>
12
2012-11-28  Tom Sepez  <tsepez@chromium.org>
2
13
3
        XSSAuditor bypass with script src=data: URL ending in <!--
14
        XSSAuditor bypass with script src=data: URL ending in <!--
- LayoutTests/fast/ruby/position-after-expected.txt +135 lines
Line 0 LayoutTests/fast/ruby/position-after-expected.txt_sec1
1
layer at (0,0) size 800x600
2
  RenderView at (0,0) size 800x600
3
layer at (0,0) size 800x600
4
  RenderBlock {HTML} at (0,0) size 800x600
5
    RenderBody {BODY} at (8,8) size 784x584
6
      RenderBlock (floating) {DIV} at (0,0) size 160x324
7
        RenderBlock {DIV} at (0,8) size 160x140
8
          RenderText {#text} at (0,0) size 160x20
9
            text run at (0,0) width 160: "xxxxx xx"
10
          RenderRuby (inline) {RUBY} at (0,0) size 80x20 [color=#0000FF]
11
            RenderRubyRun (anonymous) at (0,20) size 80x20
12
              RenderRubyText {RT} at (0,20) size 80x10 [color=#FFA500]
13
                RenderText {#text} at (25,0) size 30x10
14
                  text run at (25,0) width 30: "yyy"
15
              RenderRubyBase (anonymous) at (0,0) size 80x20
16
                RenderText {#text} at (0,0) size 80x20
17
                  text run at (0,0) width 80: "xxxx"
18
          RenderText {#text} at (80,20) size 160x50
19
            text run at (80,20) width 80: " xxx"
20
            text run at (0,50) width 160: "xxx xxxx"
21
          RenderRuby (inline) {RUBY} at (0,0) size 100x20 [color=#0000FF]
22
            RenderRubyRun (anonymous) at (0,80) size 100x20
23
              RenderRubyText {RT} at (0,20) size 100x20 [color=#FFA500]
24
                RenderText {#text} at (45,0) size 10x10
25
                  text run at (45,0) width 10: "y"
26
                RenderBR {BR} at (55,8) size 0x0
27
                RenderText {#text} at (45,10) size 10x10
28
                  text run at (45,10) width 10: "y"
29
              RenderRubyBase (anonymous) at (0,0) size 100x20
30
                RenderText {#text} at (0,0) size 100x20
31
                  text run at (0,0) width 100: "xxxxx"
32
          RenderText {#text} at (100,80) size 20x20
33
            text run at (100,80) width 20: " "
34
          RenderInline {SPAN} at (0,0) size 40x20
35
            RenderText {#text} at (120,80) size 40x20
36
              text run at (120,80) width 40: "xx"
37
          RenderText {#text} at (0,120) size 160x20
38
            text run at (0,120) width 160: "xxx xxxx"
39
        RenderBlock {DIV} at (0,156) size 140x160
40
          RenderText {#text} at (0,0) size 20x160
41
            text run at (0,0) width 160: "xxxxx xx"
42
          RenderRuby (inline) {RUBY} at (0,0) size 20x80 [color=#0000FF]
43
            RenderRubyRun (anonymous) at (30,0) size 20x80
44
              RenderRubyText {RT} at (-10,0) size 10x80 [color=#FFA500]
45
                RenderText {#text} at (0,25) size 10x30
46
                  text run at (0,25) width 30: "yyy"
47
              RenderRubyBase (anonymous) at (0,0) size 20x80
48
                RenderText {#text} at (0,0) size 20x80
49
                  text run at (0,0) width 80: "xxxx"
50
          RenderText {#text} at (30,80) size 40x160
51
            text run at (30,80) width 80: " xxx"
52
            text run at (50,0) width 160: "xxx xxxx"
53
          RenderRuby (inline) {RUBY} at (0,0) size 20x100 [color=#0000FF]
54
            RenderRubyRun (anonymous) at (90,0) size 20x100
55
              RenderRubyText {RT} at (-20,0) size 20x100 [color=#FFA500]
56
                RenderText {#text} at (0,45) size 10x10
57
                  text run at (0,45) width 10: "y"
58
                RenderBR {BR} at (2,55) size 0x0
59
                RenderText {#text} at (10,45) size 10x10
60
                  text run at (10,45) width 10: "y"
61
              RenderRubyBase (anonymous) at (0,0) size 20x100
62
                RenderText {#text} at (0,0) size 20x100
63
                  text run at (0,0) width 100: "xxxxx"
64
          RenderText {#text} at (90,100) size 20x20
65
            text run at (90,100) width 20: " "
66
          RenderInline {SPAN} at (0,0) size 20x40
67
            RenderText {#text} at (90,120) size 20x40
68
              text run at (90,120) width 40: "xx"
69
          RenderText {#text} at (120,0) size 20x160
70
            text run at (120,0) width 160: "xxx xxxx"
71
      RenderBlock (floating) {DIV} at (168,0) size 160x324
72
        RenderBlock {DIV} at (0,8) size 160x140
73
          RenderText {#text} at (0,0) size 160x20
74
            text run at (0,0) width 160: "xxxxx xx"
75
          RenderRuby (inline) {RUBY} at (0,0) size 80x20 [color=#0000FF]
76
            RenderRubyRun (anonymous) at (0,30) size 80x20
77
              RenderRubyText {RT} at (0,-10) size 80x10 [color=#FFA500]
78
                RenderText {#text} at (25,0) size 30x10
79
                  text run at (25,0) width 30: "yyy"
80
              RenderRubyBase (anonymous) at (0,0) size 80x20
81
                RenderText {#text} at (0,0) size 80x20
82
                  text run at (0,0) width 80: "xxxx"
83
          RenderText {#text} at (80,30) size 160x40
84
            text run at (80,30) width 80: " xxx"
85
            text run at (0,50) width 160: "xxx xxxx"
86
          RenderRuby (inline) {RUBY} at (0,0) size 100x20 [color=#0000FF]
87
            RenderRubyRun (anonymous) at (0,90) size 100x20
88
              RenderRubyText {RT} at (0,-20) size 100x20 [color=#FFA500]
89
                RenderText {#text} at (45,0) size 10x10
90
                  text run at (45,0) width 10: "y"
91
                RenderBR {BR} at (55,2) size 0x0
92
                RenderText {#text} at (45,10) size 10x10
93
                  text run at (45,10) width 10: "y"
94
              RenderRubyBase (anonymous) at (0,0) size 100x20
95
                RenderText {#text} at (0,0) size 100x20
96
                  text run at (0,0) width 100: "xxxxx"
97
          RenderText {#text} at (100,90) size 20x20
98
            text run at (100,90) width 20: " "
99
          RenderInline {SPAN} at (0,0) size 40x20
100
            RenderText {#text} at (120,90) size 40x20
101
              text run at (120,90) width 40: "xx"
102
          RenderText {#text} at (0,120) size 160x20
103
            text run at (0,120) width 160: "xxx xxxx"
104
        RenderBlock {DIV} at (0,156) size 140x160
105
          RenderText {#text} at (0,0) size 20x160
106
            text run at (0,0) width 160: "xxxxx xx"
107
          RenderRuby (inline) {RUBY} at (0,0) size 20x80 [color=#0000FF]
108
            RenderRubyRun (anonymous) at (20,0) size 20x80
109
              RenderRubyText {RT} at (20,0) size 10x80 [color=#FFA500]
110
                RenderText {#text} at (0,25) size 10x30
111
                  text run at (0,25) width 30: "yyy"
112
              RenderRubyBase (anonymous) at (0,0) size 20x80
113
                RenderText {#text} at (0,0) size 20x80
114
                  text run at (0,0) width 80: "xxxx"
115
          RenderText {#text} at (20,80) size 50x160
116
            text run at (20,80) width 80: " xxx"
117
            text run at (50,0) width 160: "xxx xxxx"
118
          RenderRuby (inline) {RUBY} at (0,0) size 20x100 [color=#0000FF]
119
            RenderRubyRun (anonymous) at (80,0) size 20x100
120
              RenderRubyText {RT} at (20,0) size 20x100 [color=#FFA500]
121
                RenderText {#text} at (0,45) size 10x10
122
                  text run at (0,45) width 10: "y"
123
                RenderBR {BR} at (8,55) size 0x0
124
                RenderText {#text} at (10,45) size 10x10
125
                  text run at (10,45) width 10: "y"
126
              RenderRubyBase (anonymous) at (0,0) size 20x100
127
                RenderText {#text} at (0,0) size 20x100
128
                  text run at (0,0) width 100: "xxxxx"
129
          RenderText {#text} at (80,100) size 20x20
130
            text run at (80,100) width 20: " "
131
          RenderInline {SPAN} at (0,0) size 20x40
132
            RenderText {#text} at (80,120) size 20x40
133
              text run at (80,120) width 40: "xx"
134
          RenderText {#text} at (120,0) size 20x160
135
            text run at (120,0) width 160: "xxx xxxx"
- LayoutTests/fast/ruby/position-after.html +47 lines
Line 0 LayoutTests/fast/ruby/position-after.html_sec1
1
<style>
2
    div.container {
3
        -webkit-logical-width: 8em;
4
        font: 20px ahem;
5
        -webkit-font-smoothing: none;
6
        outline: thin dashed lightblue;
7
        -webkit-ruby-position: after;
8
        margin: 8px 0;
9
    }
10
11
    span.emphasis {
12
        -webkit-text-emphasis-style: "w";
13
        -webkit-text-emphasis-color: purple;
14
    }
15
16
    ruby {
17
        color: blue;
18
    }
19
20
    rt {
21
        color: orange;
22
    }
23
</style>
24
<div style="float: left;">
25
    <div class="container">
26
        xxxxx xx <ruby>xxxx<rt>yyy</rt></ruby> xxx xxx xxxx
27
        <ruby>xxxxx<rt>y<br>y</rt></ruby> <span class="emphasis">xx</span>
28
        xxx xxxx
29
    </div>
30
    <div class="container" style="-webkit-writing-mode: vertical-lr;">
31
        xxxxx xx <ruby>xxxx<rt>yyy</rt></ruby> xxx xxx xxxx
32
        <ruby>xxxxx<rt>y<br>y</rt></ruby> <span class="emphasis">xx</span>
33
        xxx xxxx
34
    </div>
35
</div>
36
<div style="float: left; margin-left: 8px;">
37
    <div class="container" style="-webkit-writing-mode: horizontal-bt;">
38
        xxxxx xx <ruby>xxxx<rt>yyy</rt></ruby> xxx xxx xxxx
39
        <ruby>xxxxx<rt>y<br>y</rt></ruby> <span class="emphasis">xx</span>
40
        xxx xxxx
41
    </div>
42
    <div class="container" style="-webkit-writing-mode: vertical-rl;">
43
        xxxxx xx <ruby>xxxx<rt>yyy</rt></ruby> xxx xxx xxxx
44
        <ruby>xxxxx<rt>y<br>y</rt></ruby> <span class="emphasis">xx</span>
45
        xxx xxxx
46
    </div>
47
</div>

Return to Bug 103569