Ignore:
Timestamp:
Oct 28, 2013, 7:58:43 PM (12 years ago)
Author:
[email protected]
Message:

RenderElement::style() should return a reference.
<https://webkit.org/b/123414>

Now that renderers always have style, go ahead and make style()
return a RenderStyle&.

There are countless opportunities for further cleanup enabled by
this change. I'm simply passing &style() in many cases where we
can really do something nicer instead.

Reviewed by Anders Carlsson.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/rendering/RenderWidget.cpp

    r158097 r158163  
    189189        view().frameView().didAddWidgetToRenderTree(*m_widget);
    190190        // If we've already received a layout, apply the calculated space to the
    191         // widget immediately, but we have to have really been fully constructed (with a non-null
    192         // style pointer).
     191        // widget immediately, but we have to have really been fully constructed.
    193192        if (hasInitializedStyle()) {
    194193            if (!needsLayout()) {
     
    199198            }
    200199
    201             if (style()->visibility() != VISIBLE)
     200            if (style().visibility() != VISIBLE)
    202201                m_widget->hide();
    203202            else {
     
    225224    RenderReplaced::styleDidChange(diff, oldStyle);
    226225    if (m_widget) {
    227         if (style()->visibility() != VISIBLE)
     226        if (style().visibility() != VISIBLE)
    228227            m_widget->hide();
    229228        else
     
    293292
    294293#if PLATFORM(MAC)
    295     if (style()->highlight() != nullAtom && !paintInfo.context->paintingDisabled())
    296         paintCustomHighlight(paintOffset, style()->highlight(), true);
     294    if (style().highlight() != nullAtom && !paintInfo.context->paintingDisabled())
     295        paintCustomHighlight(paintOffset, style().highlight(), true);
    297296#endif
    298297
    299     if (style()->hasBorderRadius()) {
     298    if (style().hasBorderRadius()) {
    300299        LayoutRect borderRect = LayoutRect(adjustedPaintOffset, size());
    301300
     
    305304        // Push a clip if we have a border radius, since we want to round the foreground content that gets painted.
    306305        paintInfo.context->save();
    307         RoundedRect roundedInnerRect = style()->getRoundedInnerBorderFor(borderRect,
     306        RoundedRect roundedInnerRect = style().getRoundedInnerBorderFor(borderRect,
    308307            paddingTop() + borderTop(), paddingBottom() + borderBottom(), paddingLeft() + borderLeft(), paddingRight() + borderRight(), true, true);
    309308        clipRoundedInnerRect(paintInfo.context, borderRect, roundedInnerRect);
     
    313312        paintContents(paintInfo, paintOffset);
    314313
    315     if (style()->hasBorderRadius())
     314    if (style().hasBorderRadius())
    316315        paintInfo.context->restore();
    317316
     
    319318    if (isSelected() && !document().printing()) {
    320319        // FIXME: selectionRect() is in absolute, not painting coordinates.
    321         paintInfo.context->fillRect(pixelSnappedIntRect(selectionRect()), selectionBackgroundColor(), style()->colorSpace());
     320        paintInfo.context->fillRect(pixelSnappedIntRect(selectionRect()), selectionBackgroundColor(), style().colorSpace());
    322321    }
    323322
Note: See TracChangeset for help on using the changeset viewer.