⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 107289 in webkit


Ignore:
Timestamp:
Feb 9, 2012, 1:59:07 PM (15 years ago)
Author:
hyatt@apple.com
Message:

Source/WebCore: https://bugs.webkit.org/show_bug.cgi?id=78256

Rename line-grid-snap to line-snap so that it matches the draft proposal for the
property.

Reviewed by Dan Bernstein.

  • css/CSSComputedStyleDeclaration.cpp:

(WebCore):
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):

  • css/CSSParser.cpp:

(WebCore::CSSParser::parseValue):

  • css/CSSPrimitiveValueMappings.h:

(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator LineSnap):

  • css/CSSProperty.cpp:

(WebCore::CSSProperty::isInheritedProperty):

  • css/CSSPropertyNames.in:
  • css/CSSStyleApplyProperty.cpp:

(WebCore::CSSStyleApplyProperty::CSSStyleApplyProperty):

  • css/CSSStyleSelector.cpp:

(WebCore::CSSStyleSelector::applyProperty):

  • rendering/RootInlineBox.cpp:

(WebCore::RootInlineBox::alignBoxesInBlockDirection):
(WebCore::RootInlineBox::lineSnapAdjustment):

  • rendering/RootInlineBox.h:

(RootInlineBox):

  • rendering/style/RenderStyle.cpp:

(WebCore::RenderStyle::diff):

  • rendering/style/RenderStyle.h:
  • rendering/style/RenderStyleConstants.h:
  • rendering/style/StyleRareInheritedData.cpp:

(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleRareInheritedData::operator==):

  • rendering/style/StyleRareInheritedData.h:

(StyleRareInheritedData):

LayoutTests: https://bugs.webkit.org/show_bug.cgi?id=78256

Rename line-grid-snap to line-snap so that it matches the draft proposal for the
property.

Reviewed by Dan Bernstein.

  • fast/line-grid/line-grid-contains-value.html:
  • fast/line-grid/line-grid-floating.html:
  • fast/line-grid/line-grid-inside-columns.html:
  • fast/line-grid/line-grid-into-columns.html:
  • fast/line-grid/line-grid-into-floats.html:
  • fast/line-grid/line-grid-nested.html:
  • fast/line-grid/line-grid-positioned.html:
  • fast/line-grid/line-grid-snap-parsing.html: Removed.
  • fast/line-grid/line-snap-parsing-expected.txt: Added.
  • fast/line-grid/line-snap-parsing.html: Added.
  • fast/line-grid/script-tests/line-grid-snap-parsing.js: Removed.
  • fast/line-grid/script-tests/line-snap-parsing.js: Added.
Location:
trunk
Files:
3 added
3 deleted
22 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r107281 r107289  
     12012-02-09  David Hyatt  <hyatt@apple.com>
     2
     3        https://bugs.webkit.org/show_bug.cgi?id=78256
     4       
     5        Rename line-grid-snap to line-snap so that it matches the draft proposal for the
     6        property.
     7       
     8        Reviewed by Dan Bernstein.
     9
     10        * fast/line-grid/line-grid-contains-value.html:
     11        * fast/line-grid/line-grid-floating.html:
     12        * fast/line-grid/line-grid-inside-columns.html:
     13        * fast/line-grid/line-grid-into-columns.html:
     14        * fast/line-grid/line-grid-into-floats.html:
     15        * fast/line-grid/line-grid-nested.html:
     16        * fast/line-grid/line-grid-positioned.html:
     17        * fast/line-grid/line-grid-snap-parsing.html: Removed.
     18        * fast/line-grid/line-snap-parsing-expected.txt: Added.
     19        * fast/line-grid/line-snap-parsing.html: Added.
     20        * fast/line-grid/script-tests/line-grid-snap-parsing.js: Removed.
     21        * fast/line-grid/script-tests/line-snap-parsing.js: Added.
     22
    1232012-02-09  Julien Chaffraix  <jchaffraix@webkit.org>
    224
  • trunk/LayoutTests/fast/line-grid/line-grid-contains-value.html

    r107099 r107289  
    33<head>
    44<style>
    5 .grid { -webkit-line-grid: simple; -webkit-line-grid-snap: baseline;
     5.grid { -webkit-line-grid: simple; -webkit-line-snap: baseline;
    66        font-size:36px; position:absolute;
    77        padding:10px; }
     
    1010<body>
    1111<div style="left:10px; top:10px; width:600px" class="grid">
    12 <div style="-webkit-line-grid-snap:contain;font-size:48px">
     12<div style="-webkit-line-snap:contain;font-size:48px">
    1313This header should be centered in the grid lines.
    1414</div>
  • trunk/LayoutTests/fast/line-grid/line-grid-floating.html

    r105176 r107289  
    33<head>
    44<style>
    5 .grid { -webkit-line-grid: simple; -webkit-line-grid-snap: baseline;
     5.grid { -webkit-line-grid: simple; -webkit-line-snap: baseline;
    66        font-size:36px; float:left;border:2px solid black;
    77        padding:10px; margin:5px }
  • trunk/LayoutTests/fast/line-grid/line-grid-inside-columns.html

    r105176 r107289  
    33<head>
    44<style>
    5 .grid { -webkit-line-grid: simple; -webkit-line-grid-snap: baseline;
     5.grid { -webkit-line-grid: simple; -webkit-line-snap: baseline;
    66        font-size:36px; }</style>
    77</head>
  • trunk/LayoutTests/fast/line-grid/line-grid-into-columns.html

    r107160 r107289  
    33<head>
    44<style>
    5 .grid { -webkit-line-grid: simple; -webkit-line-grid-snap: baseline;
     5.grid { -webkit-line-grid: simple; -webkit-line-snap: baseline;
    66        font-size:36px; position:relative; width:800px}</style>
    77</head>
  • trunk/LayoutTests/fast/line-grid/line-grid-into-floats.html

    r105176 r107289  
    33<head>
    44<style>
    5 .grid { -webkit-line-grid: simple; -webkit-line-grid-snap: baseline;
     5.grid { -webkit-line-grid: simple; -webkit-line-snap: baseline;
    66        font-size:36px;
    77        padding:10px; }
  • trunk/LayoutTests/fast/line-grid/line-grid-positioned.html

    r105176 r107289  
    33<head>
    44<style>
    5 .grid { -webkit-line-grid: simple; -webkit-line-grid-snap: baseline;
     5.grid { -webkit-line-grid: simple; -webkit-line-snap: baseline;
    66        font-size:36px; position:absolute;border:2px solid black;
    77        padding:10px; }
  • trunk/Source/WebCore/ChangeLog

    r107288 r107289  
     12012-02-09  David Hyatt  <hyatt@apple.com>
     2
     3        https://bugs.webkit.org/show_bug.cgi?id=78256
     4       
     5        Rename line-grid-snap to line-snap so that it matches the draft proposal for the
     6        property.
     7
     8        Reviewed by Dan Bernstein.
     9
     10        * css/CSSComputedStyleDeclaration.cpp:
     11        (WebCore):
     12        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
     13        * css/CSSParser.cpp:
     14        (WebCore::CSSParser::parseValue):
     15        * css/CSSPrimitiveValueMappings.h:
     16        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
     17        (WebCore::CSSPrimitiveValue::operator LineSnap):
     18        * css/CSSProperty.cpp:
     19        (WebCore::CSSProperty::isInheritedProperty):
     20        * css/CSSPropertyNames.in:
     21        * css/CSSStyleApplyProperty.cpp:
     22        (WebCore::CSSStyleApplyProperty::CSSStyleApplyProperty):
     23        * css/CSSStyleSelector.cpp:
     24        (WebCore::CSSStyleSelector::applyProperty):
     25        * rendering/RootInlineBox.cpp:
     26        (WebCore::RootInlineBox::alignBoxesInBlockDirection):
     27        (WebCore::RootInlineBox::lineSnapAdjustment):
     28        * rendering/RootInlineBox.h:
     29        (RootInlineBox):
     30        * rendering/style/RenderStyle.cpp:
     31        (WebCore::RenderStyle::diff):
     32        * rendering/style/RenderStyle.h:
     33        * rendering/style/RenderStyleConstants.h:
     34        * rendering/style/StyleRareInheritedData.cpp:
     35        (WebCore::StyleRareInheritedData::StyleRareInheritedData):
     36        (WebCore::StyleRareInheritedData::operator==):
     37        * rendering/style/StyleRareInheritedData.h:
     38        (StyleRareInheritedData):
     39
    1402012-02-09  Benjamin Poulain  <bpoulain@apple.com>
    241
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r106884 r107289  
    244244    CSSPropertyWebkitLineClamp,
    245245    CSSPropertyWebkitLineGrid,
    246     CSSPropertyWebkitLineGridSnap,
     246    CSSPropertyWebkitLineSnap,
    247247    CSSPropertyWebkitLocale,
    248248    CSSPropertyWebkitMarginBeforeCollapse,
     
    22082208                return cssValuePool->createIdentifierValue(CSSValueNone);
    22092209            return cssValuePool->createValue(style->lineGrid(), CSSPrimitiveValue::CSS_STRING);
    2210         case CSSPropertyWebkitLineGridSnap:
    2211             return CSSPrimitiveValue::create(style->lineGridSnap());
     2210        case CSSPropertyWebkitLineSnap:
     2211            return CSSPrimitiveValue::create(style->lineSnap());
    22122212        case CSSPropertyWebkitWritingMode:
    22132213            return cssValuePool->createValue(style->writingMode());
  • trunk/Source/WebCore/css/CSSParser.cpp

    r107162 r107289  
    20502050        }
    20512051        break;
    2052     case CSSPropertyWebkitLineGridSnap:
     2052    case CSSPropertyWebkitLineSnap:
    20532053        if (id == CSSValueNone || id == CSSValueBaseline || id == CSSValueContain)
    20542054            validPrimitive = true;
  • trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h

    r106980 r107289  
    31593159}
    31603160
    3161 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(LineGridSnap gridSnap)
     3161template<> inline CSSPrimitiveValue::CSSPrimitiveValue(LineSnap gridSnap)
    31623162    : CSSValue(PrimitiveClass)
    31633163{
    31643164    m_primitiveUnitType = CSS_IDENT;
    31653165    switch (gridSnap) {
    3166     case LineGridSnapNone:
     3166    case LineSnapNone:
    31673167        m_value.ident = CSSValueNone;
    31683168        break;
    3169     case LineGridSnapBaseline:
     3169    case LineSnapBaseline:
    31703170        m_value.ident = CSSValueBaseline;
    31713171        break;
    3172     case LineGridSnapContain:
     3172    case LineSnapContain:
    31733173        m_value.ident = CSSValueContain;
    31743174        break;
     
    31763176}
    31773177
    3178 template<> inline CSSPrimitiveValue::operator LineGridSnap() const
     3178template<> inline CSSPrimitiveValue::operator LineSnap() const
    31793179{
    31803180    switch (m_value.ident) {
    31813181    case CSSValueNone:
    3182         return LineGridSnapNone;
     3182        return LineSnapNone;
    31833183    case CSSValueBaseline:
    3184         return LineGridSnapBaseline;
     3184        return LineSnapBaseline;
    31853185    case CSSValueContain:
    3186         return LineGridSnapContain;
     3186        return LineSnapContain;
    31873187    default:
    31883188        ASSERT_NOT_REACHED();
    3189         return LineGridSnapNone;
     3189        return LineSnapNone;
    31903190    }
    31913191}
  • trunk/Source/WebCore/css/CSSProperty.cpp

    r105015 r107289  
    332332    case CSSPropertyWebkitLineBreak:
    333333    case CSSPropertyWebkitLineGrid:
    334     case CSSPropertyWebkitLineGridSnap:
     334    case CSSPropertyWebkitLineSnap:
    335335    case CSSPropertyWebkitNbspMode:
    336336    case CSSPropertyWebkitPrintColorAdjust:
  • trunk/Source/WebCore/css/CSSPropertyNames.in

    r107026 r107289  
    275275-webkit-line-clamp
    276276-webkit-line-grid
    277 -webkit-line-grid-snap
     277-webkit-line-snap
    278278-webkit-logical-width
    279279-webkit-logical-height
  • trunk/Source/WebCore/css/CSSStyleApplyProperty.cpp

    r106704 r107289  
    19271927
    19281928    setPropertyHandler(CSSPropertyWebkitLineGrid, ApplyPropertyString<MapNoneToNull, &RenderStyle::lineGrid, &RenderStyle::setLineGrid, &RenderStyle::initialLineGrid>::createHandler());
    1929     setPropertyHandler(CSSPropertyWebkitLineGridSnap, ApplyPropertyDefault<LineGridSnap, &RenderStyle::lineGridSnap, LineGridSnap, &RenderStyle::setLineGridSnap, LineGridSnap, &RenderStyle::initialLineGridSnap>::createHandler());
     1929    setPropertyHandler(CSSPropertyWebkitLineSnap, ApplyPropertyDefault<LineSnap, &RenderStyle::lineSnap, LineSnap, &RenderStyle::setLineSnap, LineSnap, &RenderStyle::initialLineSnap>::createHandler());
    19301930
    19311931    setPropertyHandler(CSSPropertyWebkitTextCombine, ApplyPropertyDefault<TextCombine, &RenderStyle::textCombine, TextCombine, &RenderStyle::setTextCombine, TextCombine, &RenderStyle::initialTextCombine>::createHandler());
  • trunk/Source/WebCore/css/CSSStyleSelector.cpp

    r107279 r107289  
    40714071    case CSSPropertyWebkitHyphenateLimitLines:
    40724072    case CSSPropertyWebkitLineGrid:
    4073     case CSSPropertyWebkitLineGridSnap:
     4073    case CSSPropertyWebkitLineSnap:
    40744074    case CSSPropertyWebkitTextCombine:
    40754075    case CSSPropertyWebkitTextEmphasisPosition:
  • trunk/Source/WebCore/rendering/RootInlineBox.cpp

    r107160 r107289  
    287287    }
    288288
    289     LayoutUnit gridSnapAdjustment = lineGridSnapAdjustment();
     289    LayoutUnit gridSnapAdjustment = lineSnapAdjustment();
    290290    if (gridSnapAdjustment) {
    291291        adjustBlockDirectionPosition(gridSnapAdjustment);
     
    327327}
    328328
    329 LayoutUnit RootInlineBox::lineGridSnapAdjustment(LayoutUnit delta) const
     329LayoutUnit RootInlineBox::lineSnapAdjustment(LayoutUnit delta) const
    330330{
    331331    // If our block doesn't have snapping turned on, do nothing.
    332332    // FIXME: Implement bounds snapping.
    333     if (block()->style()->lineGridSnap() == LineGridSnapNone)
     333    if (block()->style()->lineSnap() == LineSnapNone)
    334334        return 0;
    335335
     
    378378    }
    379379
    380     if (block()->style()->lineGridSnap() == LineGridSnapContain) {
     380    if (block()->style()->lineSnap() == LineSnapContain) {
    381381        // Compute the desired offset from the text-top of a grid line.
    382382        // Look at our height (logicalHeight()).
     
    415415   
    416416    // Put ourselves at the top of the next page to force a snap onto the new grid established by that page.
    417     return lineGridSnapAdjustment(newPageLogicalTop - (blockOffset + lineTopWithLeading()));
     417    return lineSnapAdjustment(newPageLogicalTop - (blockOffset + lineTopWithLeading()));
    418418}
    419419
  • trunk/Source/WebCore/rendering/RootInlineBox.h

    r106900 r107289  
    184184    void setHasEllipsisBox(bool hasEllipsisBox) { m_hasEllipsisBoxOrHyphen = hasEllipsisBox; }
    185185   
    186     LayoutUnit lineGridSnapAdjustment(LayoutUnit delta = 0) const;
     186    LayoutUnit lineSnapAdjustment(LayoutUnit delta = 0) const;
    187187
    188188    int beforeAnnotationsAdjustment() const;
  • trunk/Source/WebCore/rendering/style/RenderStyle.cpp

    r105403 r107289  
    467467            || rareInheritedData->m_lineBoxContain != other->rareInheritedData->m_lineBoxContain
    468468            || rareInheritedData->m_lineGrid != other->rareInheritedData->m_lineGrid
    469             || rareInheritedData->m_lineGridSnap != other->rareInheritedData->m_lineGridSnap)
     469            || rareInheritedData->m_lineSnap != other->rareInheritedData->m_lineSnap)
    470470            return StyleDifferenceLayout;
    471471
  • trunk/Source/WebCore/rendering/style/RenderStyle.h

    r105903 r107289  
    904904
    905905    const AtomicString& lineGrid() const { return rareInheritedData->m_lineGrid; }
    906     LineGridSnap lineGridSnap() const { return static_cast<LineGridSnap>(rareInheritedData->m_lineGridSnap); }
     906    LineSnap lineSnap() const { return static_cast<LineSnap>(rareInheritedData->m_lineSnap); }
    907907
    908908    WrapFlow wrapFlow() const { return static_cast<WrapFlow>(rareNonInheritedData->m_wrapFlow); }
     
    13031303
    13041304    void setLineGrid(const AtomicString& lineGrid) { SET_VAR(rareInheritedData, m_lineGrid, lineGrid); }
    1305     void setLineGridSnap(LineGridSnap lineGridSnap) { SET_VAR(rareInheritedData, m_lineGridSnap, lineGridSnap); }
     1305    void setLineSnap(LineSnap lineSnap) { SET_VAR(rareInheritedData, m_lineSnap, lineSnap); }
    13061306
    13071307    void setFlowThread(const AtomicString& flowThread) { SET_VAR(rareNonInheritedData, m_flowThread, flowThread); }
     
    16321632
    16331633    static const AtomicString& initialLineGrid() { return nullAtom; }
    1634     static LineGridSnap initialLineGridSnap() { return LineGridSnapNone; }
     1634    static LineSnap initialLineSnap() { return LineSnapNone; }
    16351635
    16361636    static const AtomicString& initialFlowThread() { return nullAtom; }
  • trunk/Source/WebCore/rendering/style/RenderStyleConstants.h

    r106980 r107289  
    455455enum ColumnAxis { HorizontalColumnAxis, VerticalColumnAxis, AutoColumnAxis };
    456456
    457 enum LineGridSnap { LineGridSnapNone, LineGridSnapBaseline, LineGridSnapContain };
     457enum LineSnap { LineSnapNone, LineSnapBaseline, LineSnapContain };
    458458
    459459enum WrapFlow { WrapFlowAuto, WrapFlowBoth, WrapFlowLeft, WrapFlowRight, WrapFlowMaximum, WrapFlowClear };
  • trunk/Source/WebCore/rendering/style/StyleRareInheritedData.cpp

    r99902 r107289  
    5454    , m_lineBoxContain(RenderStyle::initialLineBoxContain())
    5555    , m_imageRendering(RenderStyle::initialImageRendering())
    56     , m_lineGridSnap(RenderStyle::initialLineGridSnap())
     56    , m_lineSnap(RenderStyle::initialLineSnap())
    5757    , hyphenationLimitBefore(-1)
    5858    , hyphenationLimitAfter(-1)
     
    9898    , m_lineBoxContain(o.m_lineBoxContain)
    9999    , m_imageRendering(o.m_imageRendering)
    100     , m_lineGridSnap(o.m_lineGridSnap)
     100    , m_lineSnap(o.m_lineSnap)
    101101    , hyphenationString(o.hyphenationString)
    102102    , hyphenationLimitBefore(o.hyphenationLimitBefore)
     
    169169        && m_lineGrid == o.m_lineGrid
    170170        && m_imageRendering == o.m_imageRendering
    171         && m_lineGridSnap == o.m_lineGridSnap;
     171        && m_lineSnap == o.m_lineSnap;
    172172}
    173173
  • trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h

    r99902 r107289  
    9292    // CSS Image Values Level 3
    9393    unsigned m_imageRendering : 2; // EImageRendering
    94     unsigned m_lineGridSnap : 2; // LineGridSnap
     94    unsigned m_lineSnap : 2; // LineSnap
    9595
    9696    AtomicString hyphenationString;
Note: See TracChangeset for help on using the changeset viewer.