Changeset 200098 in webkit
- Timestamp:
- Apr 26, 2016 11:20:09 AM (8 years ago)
- Location:
- trunk/Source
- Files:
-
- 117 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r200094 r200098 1 2016-04-26 Antti Koivisto <antti@apple.com> 2 3 RenderElement::style() should return const RenderStyle 4 https://bugs.webkit.org/show_bug.cgi?id=157016 5 6 Reviewed by Geoff Garen. 7 8 Style should be changed via setStyle, not by mutating it directly. 9 10 Pulling this string turns RenderStyle const in many places. 11 12 * accessibility/AccessibilityObject.cpp: 13 (WebCore::startOfStyleRange): 14 * accessibility/atk/WebKitAccessibleInterfaceText.cpp: 15 (getAttributeSetForAccessibilityObject): 16 * bindings/objc/DOM.mm: 17 (-[DOMNode innerFrameQuad]): 18 (-[DOMNode computedFontSize]): 19 * css/CSSComputedStyleDeclaration.cpp: 20 (WebCore::createPositionListForLayer): 21 (WebCore::positionOffsetValue): 22 (WebCore::ComputedStyleExtractor::currentColorOrValidColor): 23 (WebCore::getTransitionPropertyValue): 24 (WebCore::scrollSnapDestination): 25 (WebCore::scrollSnapPoints): 26 (WebCore::scrollSnapCoordinates): 27 (WebCore::logUnimplementedPropertyID): 28 (WebCore::fontFamilyFromStyle): 29 (WebCore::lineHeightFromStyle): 30 (WebCore::fontSizeFromStyle): 31 (WebCore::fontStyleFromStyle): 32 (WebCore::fontVariantFromStyle): 33 (WebCore::fontWeightFromStyle): 34 (WebCore::fontSynthesisFromStyle): 35 (WebCore::zoomAdjustedPaddingOrMarginPixelValue): 36 (WebCore::paddingOrMarginIsRendererDependent): 37 (WebCore::convertToRegionBreak): 38 (WebCore::isLayoutDependent): 39 (WebCore::updateStyleIfNeededForNode): 40 (WebCore::computeRenderStyleForProperty): 41 (WebCore::ComputedStyleExtractor::propertyValue): 42 (WebCore::CSSComputedStyleDeclaration::length): 43 (WebCore::CSSComputedStyleDeclaration::item): 44 (WebCore::ComputedStyleExtractor::propertyMatches): 45 * css/CSSComputedStyleDeclaration.h: 46 * css/CSSToLengthConversionData.cpp: 47 (WebCore::CSSToLengthConversionData::viewportWidthFactor): 48 (WebCore::CSSToLengthConversionData::viewportHeightFactor): 49 (WebCore::CSSToLengthConversionData::viewportMinFactor): 50 (WebCore::CSSToLengthConversionData::viewportMaxFactor): 51 * css/CSSToLengthConversionData.h: 52 (WebCore::CSSToLengthConversionData::CSSToLengthConversionData): 53 (WebCore::CSSToLengthConversionData::style): 54 (WebCore::CSSToLengthConversionData::rootStyle): 55 (WebCore::CSSToLengthConversionData::computingFontSize): 56 (WebCore::CSSToLengthConversionData::copyWithAdjustedZoom): 57 * css/CSSToStyleMap.cpp: 58 (WebCore::CSSToStyleMap::style): 59 (WebCore::CSSToStyleMap::rootElementStyle): 60 * css/CSSToStyleMap.h: 61 * css/MediaQueryEvaluator.cpp: 62 (WebCore::MediaQueryEvaluator::MediaQueryEvaluator): 63 * css/MediaQueryEvaluator.h: 64 * css/SVGCSSComputedStyleDeclaration.cpp: 65 (WebCore::strokeDashArrayToCSSValueList): 66 (WebCore::ComputedStyleExtractor::adjustSVGPaintForCurrentColor): 67 (WebCore::ComputedStyleExtractor::svgPropertyValue): 68 * css/SourceSizeList.cpp: 69 (WebCore::match): 70 (WebCore::defaultLength): 71 (WebCore::computeLength): 72 (WebCore::parseSizesAttribute): 73 * css/StyleBuilderCustom.h: 74 (WebCore::ApplyPropertyBorderImageModifier::applyValue): 75 (WebCore::ApplyPropertyBorderImageModifier::getValue): 76 (WebCore::StyleBuilderCustom::applyInheritClip): 77 (WebCore::StyleBuilderCustom::applyInheritCounter): 78 (WebCore::StyleBuilderCustom::applyValueContent): 79 (WebCore::StyleBuilderCustom::applyValueAlt): 80 * css/StyleResolver.cpp: 81 (WebCore::StyleResolver::sweepMatchedPropertiesCache): 82 (WebCore::StyleResolver::State::State): 83 (WebCore::isAtShadowBoundary): 84 (WebCore::StyleResolver::styleForElement): 85 (WebCore::StyleResolver::keyframeStylesForAnimation): 86 (WebCore::StyleResolver::pseudoStyleForElement): 87 (WebCore::StyleResolver::applyProperty): 88 (WebCore::StyleResolver::checkForTextSizeAdjust): 89 (WebCore::StyleResolver::checkForZoomChange): 90 (WebCore::StyleResolver::checkForGenericFamilyChange): 91 * css/StyleResolver.h: 92 (WebCore::StyleResolver::style): 93 (WebCore::StyleResolver::parentStyle): 94 (WebCore::StyleResolver::rootElementStyle): 95 (WebCore::StyleResolver::element): 96 (WebCore::StyleResolver::document): 97 (WebCore::StyleResolver::documentSettings): 98 (WebCore::StyleResolver::State::State): 99 (WebCore::StyleResolver::State::takeStyle): 100 (WebCore::StyleResolver::State::parentStyle): 101 (WebCore::StyleResolver::State::rootElementStyle): 102 (WebCore::StyleResolver::State::regionForStyling): 103 (WebCore::StyleResolver::State::elementLinkState): 104 * dom/Document.cpp: 105 (WebCore::Document::updateLayoutIgnorePendingStylesheets): 106 (WebCore::Document::styleForElementIgnoringPendingStylesheets): 107 (WebCore::Document::setVisuallyOrdered): 108 (WebCore::Document::createParser): 109 * dom/Document.h: 110 * dom/Element.cpp: 111 (WebCore::Element::styleResolver): 112 (WebCore::Element::resolveStyle): 113 (WebCore::checkForEmptyStyleChange): 114 (WebCore::checkForSiblingStyleChanges): 115 (WebCore::beforeOrAfterPseudoElement): 116 (WebCore::Element::existingComputedStyle): 117 (WebCore::Element::resolveComputedStyle): 118 (WebCore::Element::computedStyle): 119 (WebCore::Element::didDetachRenderers): 120 (WebCore::Element::resolveCustomStyle): 121 * dom/Element.h: 122 * dom/Node.cpp: 123 (WebCore::computeEditabilityFromComputedStyle): 124 (WebCore::Node::pseudoAwareLastChild): 125 (WebCore::Node::computedStyle): 126 * dom/Node.h: 127 * dom/NodeRenderStyle.h: 128 (WebCore::Node::renderStyle): 129 * dom/PseudoElement.cpp: 130 (WebCore::PseudoElement::clearHostElement): 131 (WebCore::PseudoElement::resolveCustomStyle): 132 * dom/PseudoElement.h: 133 * editing/ApplyBlockElementCommand.cpp: 134 (WebCore::isNewLineAtPosition): 135 (WebCore::ApplyBlockElementCommand::renderStyleOfEnclosingTextNode): 136 (WebCore::ApplyBlockElementCommand::rangeForParagraphSplittingTextNodesIfNeeded): 137 (WebCore::ApplyBlockElementCommand::endOfNextParagraphSplittingTextNodesIfNeeded): 138 * editing/ApplyBlockElementCommand.h: 139 * editing/EditingStyle.cpp: 140 (WebCore::EditingStyle::init): 141 (WebCore::EditingStyle::removeTextFillAndStrokeColorsIfNeeded): 142 * editing/EditingStyle.h: 143 * editing/Editor.h: 144 * editing/SimplifyMarkupCommand.cpp: 145 (WebCore::SimplifyMarkupCommand::doApply): 146 * editing/cocoa/EditorCocoa.mm: 147 (WebCore::Editor::styleForSelectionStart): 148 (WebCore::Editor::getTextDecorationAttributesRespectingTypingStyle): 149 * editing/ios/EditorIOS.mm: 150 (WebCore::Editor::fontForSelection): 151 (WebCore::Editor::fontAttributesForSelectionStart): 152 * editing/mac/EditorMac.mm: 153 (WebCore::Editor::fontForSelection): 154 (WebCore::Editor::fontAttributesForSelectionStart): 155 * html/HTMLTitleElement.cpp: 156 (WebCore::HTMLTitleElement::computedTextWithDirection): 157 * html/canvas/CanvasRenderingContext2D.cpp: 158 (WebCore::CanvasRenderingContext2D::FontProxy::fontsNeedUpdate): 159 (WebCore::CanvasRenderingContext2D::FontProxy::initialize): 160 (WebCore::CanvasRenderingContext2D::setFont): 161 (WebCore::CanvasRenderingContext2D::setTextBaseline): 162 (WebCore::CanvasRenderingContext2D::toTextDirection): 163 (WebCore::CanvasRenderingContext2D::drawTextInternal): 164 * html/canvas/CanvasRenderingContext2D.h: 165 * html/parser/HTMLResourcePreloader.cpp: 166 (WebCore::HTMLResourcePreloader::preload): 167 (WebCore::mediaAttributeMatches): 168 * html/shadow/SliderThumbElement.cpp: 169 (WebCore::RenderSliderThumb::RenderSliderThumb): 170 (WebCore::RenderSliderThumb::updateAppearance): 171 (WebCore::RenderSliderContainer::layout): 172 (WebCore::SliderThumbElement::hostInput): 173 (WebCore::SliderThumbElement::resolveCustomStyle): 174 (WebCore::SliderContainerElement::createElementRenderer): 175 (WebCore::SliderContainerElement::resolveCustomStyle): 176 * html/shadow/SliderThumbElement.h: 177 * html/shadow/TextControlInnerElements.cpp: 178 (WebCore::TextControlInnerElement::create): 179 (WebCore::TextControlInnerElement::resolveCustomStyle): 180 (WebCore::TextControlInnerTextElement::renderer): 181 (WebCore::TextControlInnerTextElement::resolveCustomStyle): 182 (WebCore::TextControlPlaceholderElement::TextControlPlaceholderElement): 183 (WebCore::TextControlPlaceholderElement::resolveCustomStyle): 184 * html/shadow/TextControlInnerElements.h: 185 * page/EventHandler.cpp: 186 (WebCore::EventHandler::selectCursor): 187 * page/animation/AnimationBase.cpp: 188 (WebCore::solveStepsFunction): 189 (WebCore::AnimationBase::AnimationBase): 190 * page/animation/AnimationBase.h: 191 (WebCore::AnimationBase::~AnimationBase): 192 (WebCore::AnimationBase::renderer): 193 (WebCore::AnimationBase::animation): 194 (WebCore::AnimationBase::setAnimation): 195 * page/animation/AnimationController.cpp: 196 (WebCore::AnimationController::cancelAnimations): 197 (WebCore::AnimationController::updateAnimations): 198 * page/animation/AnimationController.h: 199 * page/animation/CompositeAnimation.cpp: 200 (WebCore::CompositeAnimation::clearRenderer): 201 (WebCore::CompositeAnimation::updateTransitions): 202 (WebCore::CompositeAnimation::updateKeyframeAnimations): 203 (WebCore::CompositeAnimation::animate): 204 * page/animation/CompositeAnimation.h: 205 * page/animation/ImplicitAnimation.cpp: 206 (WebCore::ImplicitAnimation::ImplicitAnimation): 207 (WebCore::ImplicitAnimation::shouldSendEventForListener): 208 (WebCore::ImplicitAnimation::animate): 209 (WebCore::ImplicitAnimation::sendTransitionEvent): 210 (WebCore::ImplicitAnimation::reset): 211 * page/animation/ImplicitAnimation.h: 212 (WebCore::ImplicitAnimation::create): 213 * page/animation/KeyframeAnimation.cpp: 214 (WebCore::KeyframeAnimation::KeyframeAnimation): 215 (WebCore::KeyframeAnimation::fetchIntervalEndpointsForProperty): 216 (WebCore::KeyframeAnimation::animate): 217 * page/animation/KeyframeAnimation.h: 218 * page/ios/FrameIOS.mm: 219 (WebCore::ancestorRespondingToScrollWheelEvents): 220 * rendering/FlowThreadController.cpp: 221 (WebCore::FlowThreadController::styleDidChange): 222 * rendering/InlineFlowBox.cpp: 223 (WebCore::clipRectForNinePieceImageStrip): 224 * rendering/RenderBlock.cpp: 225 (WebCore::RenderBlock::styleDidChange): 226 (WebCore::RenderBlock::lineHeight): 227 (WebCore::RenderBlock::firstLineBlock): 228 (WebCore::styleForFirstLetter): 229 (WebCore::RenderBlock::updateFirstLetterStyle): 230 (WebCore::RenderBlock::createFirstLetterRenderer): 231 * rendering/RenderBlockFlow.cpp: 232 (WebCore::RenderBlockFlow::adjustBlockChildForPagination): 233 (WebCore::calculateMinimumPageHeight): 234 (WebCore::RenderBlockFlow::adjustComputedFontSizes): 235 * rendering/RenderBox.cpp: 236 (WebCore::RenderBox::styleDidChange): 237 (WebCore::RenderBox::borderRadii): 238 (WebCore::RenderBox::enclosingFloatPaintingLayer): 239 (WebCore::RenderBox::logicalVisualOverflowRectForPropagation): 240 (WebCore::RenderBox::visualOverflowRectForPropagation): 241 (WebCore::RenderBox::logicalLayoutOverflowRectForPropagation): 242 (WebCore::RenderBox::layoutOverflowRectForPropagation): 243 * rendering/RenderBox.h: 244 (WebCore::RenderBox::applyTopLeftLocationOffset): 245 (WebCore::RenderBox::hasRenderOverflow): 246 (WebCore::RenderBox::hasVisualOverflow): 247 * rendering/RenderBoxModelObject.cpp: 248 (WebCore::RenderBoxModelObject::backgroundRoundedRectAdjustedForBleedAvoidance): 249 (WebCore::applyBoxShadowForBackground): 250 * rendering/RenderButton.cpp: 251 (WebCore::RenderButton::addChild): 252 (WebCore::RenderButton::styleWillChange): 253 (WebCore::RenderButton::styleDidChange): 254 (WebCore::RenderButton::setupInnerStyle): 255 (WebCore::RenderButton::layout): 256 * rendering/RenderDeprecatedFlexibleBox.cpp: 257 (WebCore::RenderDeprecatedFlexibleBox::styleWillChange): 258 * rendering/RenderElement.cpp: 259 (WebCore::RenderElement::createFor): 260 (WebCore::RenderElement::uncachedFirstLineStyle): 261 (WebCore::RenderElement::cachedFirstLineStyle): 262 (WebCore::RenderElement::firstLineStyle): 263 (WebCore::RenderElement::styleWillChange): 264 (WebCore::RenderElement::addControlStatesForRenderer): 265 (WebCore::RenderElement::getCachedPseudoStyle): 266 (WebCore::RenderElement::getMutableCachedPseudoStyle): 267 (WebCore::RenderElement::getUncachedPseudoStyle): 268 (WebCore::RenderElement::paintOutline): 269 * rendering/RenderElement.h: 270 (WebCore::RenderElement::hasInitializedStyle): 271 (WebCore::RenderElement::style): 272 (WebCore::RenderElement::mutableStyle): 273 (WebCore::RenderElement::element): 274 (WebCore::RenderObject::isRenderInline): 275 (WebCore::RenderObject::style): 276 (WebCore::RenderObject::firstLineStyle): 277 * rendering/RenderEmbeddedObject.cpp: 278 (WebCore::RenderEmbeddedObject::layout): 279 * rendering/RenderFlowThread.cpp: 280 (WebCore::RenderFlowThread::RenderFlowThread): 281 (WebCore::RenderFlowThread::createFlowThreadStyle): 282 * rendering/RenderFlowThread.h: 283 * rendering/RenderImage.cpp: 284 (WebCore::RenderImage::layoutShadowControls): 285 * rendering/RenderInline.cpp: 286 (WebCore::RenderInline::styleDidChange): 287 (WebCore::RenderInline::updateAlwaysCreateLineBoxes): 288 (WebCore::RenderInline::paintOutline): 289 * rendering/RenderLayer.cpp: 290 (WebCore::RenderLayer::setupClipPath): 291 * rendering/RenderListBox.cpp: 292 (WebCore::RenderListBox::paintScrollbar): 293 (WebCore::itemOffsetForAlignment): 294 (WebCore::RenderListBox::paintItemForeground): 295 (WebCore::RenderListBox::paintItemBackground): 296 * rendering/RenderListMarker.cpp: 297 (WebCore::RenderListMarker::updateMargins): 298 (WebCore::RenderListMarker::lineHeight): 299 * rendering/RenderMarquee.cpp: 300 (WebCore::RenderMarquee::computePosition): 301 (WebCore::RenderMarquee::updateMarqueeStyle): 302 * rendering/RenderMenuList.cpp: 303 (WebCore::RenderMenuList::adjustInnerStyle): 304 (RenderMenuList::updateOptionsWidth): 305 (RenderMenuList::itemStyle): 306 * rendering/RenderMultiColumnFlowThread.cpp: 307 (WebCore::isValidColumnSpanner): 308 * rendering/RenderMultiColumnSpannerPlaceholder.cpp: 309 (WebCore::RenderMultiColumnSpannerPlaceholder::createAnonymous): 310 * rendering/RenderMultiColumnSpannerPlaceholder.h: 311 * rendering/RenderNamedFlowFragment.cpp: 312 (WebCore::RenderNamedFlowFragment::checkRegionStyle): 313 (WebCore::RenderNamedFlowFragment::computeStyleInRegion): 314 * rendering/RenderNamedFlowFragment.h: 315 * rendering/RenderObject.cpp: 316 (WebCore::RenderObject::innerLineHeight): 317 (WebCore::decorationColor): 318 (WebCore::RenderObject::getTextDecorationColorsAndStyles): 319 * rendering/RenderObject.h: 320 (WebCore::RenderObject::minPreferredLogicalWidth): 321 (WebCore::RenderObject::maxPreferredLogicalWidth): 322 * rendering/RenderTable.cpp: 323 (WebCore::RenderTable::computePreferredLogicalWidths): 324 * rendering/RenderTableSection.cpp: 325 (WebCore::RenderTableSection::paintRowGroupBorderIfRequired): 326 (WebCore::physicalBorderForDirection): 327 * rendering/RenderText.h: 328 (WebCore::RenderText::characterAt): 329 (WebCore::RenderText::style): 330 (WebCore::RenderText::firstLineStyle): 331 (WebCore::RenderText::getCachedPseudoStyle): 332 * rendering/RenderTextControl.cpp: 333 (WebCore::RenderTextControl::styleDidChange): 334 * rendering/RenderTextControlMultiLine.cpp: 335 (WebCore::RenderTextControlMultiLine::layoutSpecialExcludedChild): 336 * rendering/RenderTextControlSingleLine.cpp: 337 (WebCore::RenderTextControlSingleLine::layout): 338 (WebCore::RenderTextControlSingleLine::styleDidChange): 339 * rendering/RenderTextFragment.cpp: 340 (WebCore::RenderTextFragment::styleDidChange): 341 * rendering/RenderThemeGtk.cpp: 342 (WebCore::RenderThemeGtk::paintMediaToggleClosedCaptionsButton): 343 (WebCore::borderRadiiFromStyle): 344 (WebCore::RenderThemeGtk::paintMediaSliderTrack): 345 (WebCore::RenderThemeGtk::paintMediaSliderThumb): 346 (WebCore::RenderThemeGtk::paintMediaVolumeSliderTrack): 347 * rendering/SimpleLineLayoutFunctions.cpp: 348 (WebCore::SimpleLineLayout::paintFlow): 349 (WebCore::SimpleLineLayout::hitTestFlow): 350 * rendering/TextAutoSizing.cpp: 351 (WebCore::TextAutoSizingKey::TextAutoSizingKey): 352 * rendering/TextAutoSizing.h: 353 (WebCore::TextAutoSizingKey::style): 354 (WebCore::TextAutoSizingKey::isDeleted): 355 * rendering/TextPaintStyle.cpp: 356 (WebCore::computeTextSelectionPaintStyle): 357 * rendering/line/BreakingContext.h: 358 * rendering/mathml/RenderMathMLRoot.cpp: 359 (WebCore::RenderMathMLRoot::layout): 360 * rendering/style/RenderStyle.h: 361 (WebCore::RenderStyle::setColumnRuleWidth): 362 (WebCore::RenderStyle::resetColumnRule): 363 (WebCore::RenderStyle::setColumnSpan): 364 (WebCore::RenderStyle::inheritColumnPropertiesFrom): 365 (WebCore::RenderStyle::setTransform): 366 (WebCore::RenderStyle::setTransformOriginX): 367 (WebCore::RenderStyle::setTransformOriginY): 368 * rendering/svg/SVGInlineTextBox.cpp: 369 (WebCore::SVGInlineTextBox::positionForOffset): 370 (WebCore::SVGInlineTextBox::selectionRectForTextFragment): 371 (WebCore::SVGInlineTextBox::localSelectionRect): 372 (WebCore::SVGInlineTextBox::paintSelectionBackground): 373 (WebCore::SVGInlineTextBox::paint): 374 (WebCore::SVGInlineTextBox::acquirePaintingResource): 375 (WebCore::SVGInlineTextBox::releasePaintingResource): 376 (WebCore::SVGInlineTextBox::prepareGraphicsContextForTextPainting): 377 (WebCore::SVGInlineTextBox::restoreGraphicsContextAfterTextPainting): 378 (WebCore::SVGInlineTextBox::constructTextRun): 379 (WebCore::SVGInlineTextBox::paintDecorationWithStyle): 380 (WebCore::SVGInlineTextBox::paintTextWithShadows): 381 (WebCore::SVGInlineTextBox::paintText): 382 * rendering/svg/SVGInlineTextBox.h: 383 * rendering/svg/SVGPathData.cpp: 384 (WebCore::updatePathFromCircleElement): 385 (WebCore::updatePathFromEllipseElement): 386 (WebCore::updatePathFromRectElement): 387 * rendering/svg/SVGRenderingContext.cpp: 388 (WebCore::SVGRenderingContext::prepareToRenderSVGContent): 389 * style/StyleTreeResolver.cpp: 390 (WebCore::Style::TreeResolver::Parent::Parent): 391 (WebCore::Style::TreeResolver::popScope): 392 (WebCore::Style::TreeResolver::styleForElement): 393 (WebCore::Style::TreeResolver::pushParent): 394 (WebCore::Style::TreeResolver::resolveComposedTree): 395 * style/StyleTreeResolver.h: 396 (WebCore::Style::TreeResolver::scope): 397 * style/StyleUpdate.cpp: 398 (WebCore::Style::Update::textUpdate): 399 (WebCore::Style::Update::elementStyle): 400 (WebCore::Style::Update::addElement): 401 * style/StyleUpdate.h: 402 (WebCore::Style::Update::document): 403 * svg/SVGElement.cpp: 404 (WebCore::SVGElement::synchronizeSystemLanguage): 405 (WebCore::SVGElement::resolveCustomStyle): 406 (WebCore::SVGElement::setUseOverrideComputedStyle): 407 (WebCore::SVGElement::computedStyle): 408 * svg/SVGElement.h: 409 * svg/SVGElementRareData.h: 410 (WebCore::SVGElementRareData::ensureAnimatedSMILStyleProperties): 411 (WebCore::SVGElementRareData::overrideComputedStyle): 412 * svg/SVGGraphicsElement.cpp: 413 (WebCore::SVGGraphicsElement::animatedLocalTransform): 414 * svg/SVGLengthContext.cpp: 415 (WebCore::SVGLengthContext::convertValueFromPercentageToUserUnits): 416 (WebCore::renderStyleForLengthResolving): 417 (WebCore::SVGLengthContext::convertValueFromUserUnitsToEMS): 418 (WebCore::SVGLengthContext::convertValueFromEMSToUserUnits): 419 (WebCore::SVGLengthContext::convertValueFromUserUnitsToEXS): 420 (WebCore::SVGLengthContext::convertValueFromEXSToUserUnits): 421 * svg/SVGStopElement.cpp: 422 (WebCore::SVGStopElement::stopColorIncludingOpacity): 423 * svg/SVGTextElement.cpp: 424 (WebCore::SVGTextElement::animatedLocalTransform): 425 1 426 2016-04-26 Myles C. Maxfield <mmaxfield@apple.com> 2 427 -
trunk/Source/WebCore/accessibility/AccessibilityObject.cpp
r199817 r200098 1135 1135 RenderObject* renderer = visiblePos.deepEquivalent().deprecatedNode()->renderer(); 1136 1136 RenderObject* startRenderer = renderer; 1137 RenderStyle* style = &renderer->style();1137 auto* style = &renderer->style(); 1138 1138 1139 1139 // traverse backward by renderer to look for style change -
trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp
r185502 r200098 85 85 86 86 RenderObject* renderer = object->renderer(); 87 RenderStyle* style = &renderer->style();87 auto* style = &renderer->style(); 88 88 89 89 AtkAttributeSet* result = nullptr; -
trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm
r199817 r200098 1991 1991 static void AXAttributeStringSetStyle(NSMutableAttributedString* attrString, RenderObject* renderer, NSRange range) 1992 1992 { 1993 RenderStyle& style = renderer->style();1993 auto& style = renderer->style(); 1994 1994 1995 1995 // set basic font info -
trunk/Source/WebCore/bindings/objc/DOM.mm
r197892 r200098 500 500 return emptyQuad(); 501 501 502 RenderStyle& style = renderer->style();502 auto& style = renderer->style(); 503 503 IntRect boundingBox = renderer->absoluteBoundingBoxRect(true /* use transforms*/); 504 504 … … 514 514 { 515 515 WebCore::Node *node = core(self); 516 RenderStyle*style = node->renderStyle();516 auto *style = node->renderStyle(); 517 517 if (!style) 518 518 return 0.0f; -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r199981 r200098 701 701 } 702 702 703 static RefPtr<CSSValue> positionOffsetValue( RenderStyle& style, CSSPropertyID propertyID)703 static RefPtr<CSSValue> positionOffsetValue(const RenderStyle& style, CSSPropertyID propertyID) 704 704 { 705 705 Length length; … … 738 738 } 739 739 740 RefPtr<CSSPrimitiveValue> ComputedStyleExtractor::currentColorOrValidColor( RenderStyle* style, const Color& color) const740 RefPtr<CSSPrimitiveValue> ComputedStyleExtractor::currentColorOrValidColor(const RenderStyle* style, const Color& color) const 741 741 { 742 742 // This function does NOT look at visited information, so that computed style doesn't expose that. … … 1144 1144 1145 1145 #if ENABLE(CSS_SCROLL_SNAP) 1146 static Ref<CSSValueList> scrollSnapDestination( RenderStyle& style, const LengthSize& destination)1146 static Ref<CSSValueList> scrollSnapDestination(const RenderStyle& style, const LengthSize& destination) 1147 1147 { 1148 1148 auto list = CSSValueList::createSpaceSeparated(); … … 1152 1152 } 1153 1153 1154 static Ref<CSSValue> scrollSnapPoints( RenderStyle& style, const ScrollSnapPoints* points)1154 static Ref<CSSValue> scrollSnapPoints(const RenderStyle& style, const ScrollSnapPoints* points) 1155 1155 { 1156 1156 if (!points) … … 1167 1167 } 1168 1168 1169 static Ref<CSSValue> scrollSnapCoordinates( RenderStyle& style, const Vector<LengthSize>& coordinates)1169 static Ref<CSSValue> scrollSnapCoordinates(const RenderStyle& style, const Vector<LengthSize>& coordinates) 1170 1170 { 1171 1171 if (coordinates.isEmpty()) … … 1808 1808 } 1809 1809 1810 static Ref<CSSValueList> fontFamilyFromStyle( RenderStyle* style)1810 static Ref<CSSValueList> fontFamilyFromStyle(const RenderStyle* style) 1811 1811 { 1812 1812 auto list = CSSValueList::createCommaSeparated(); … … 1816 1816 } 1817 1817 1818 static Ref<CSSPrimitiveValue> lineHeightFromStyle( RenderStyle& style)1818 static Ref<CSSPrimitiveValue> lineHeightFromStyle(const RenderStyle& style) 1819 1819 { 1820 1820 Length length = style.lineHeight(); … … 1831 1831 } 1832 1832 1833 static Ref<CSSPrimitiveValue> fontSizeFromStyle( RenderStyle& style)1833 static Ref<CSSPrimitiveValue> fontSizeFromStyle(const RenderStyle& style) 1834 1834 { 1835 1835 return zoomAdjustedPixelValue(style.fontDescription().computedSize(), style); 1836 1836 } 1837 1837 1838 static Ref<CSSPrimitiveValue> fontStyleFromStyle( RenderStyle* style)1838 static Ref<CSSPrimitiveValue> fontStyleFromStyle(const RenderStyle* style) 1839 1839 { 1840 1840 if (style->fontDescription().italic()) … … 1843 1843 } 1844 1844 1845 static Ref<CSSValue> fontVariantFromStyle( RenderStyle* style)1845 static Ref<CSSValue> fontVariantFromStyle(const RenderStyle* style) 1846 1846 { 1847 1847 if (style->fontDescription().variantSettings().isAllNormal()) … … 2030 2030 } 2031 2031 2032 static Ref<CSSPrimitiveValue> fontWeightFromStyle( RenderStyle* style)2032 static Ref<CSSPrimitiveValue> fontWeightFromStyle(const RenderStyle* style) 2033 2033 { 2034 2034 switch (style->fontDescription().weight()) { … … 2056 2056 } 2057 2057 2058 static Ref<CSSValue> fontSynthesisFromStyle( RenderStyle& style)2058 static Ref<CSSValue> fontSynthesisFromStyle(const RenderStyle& style) 2059 2059 { 2060 2060 if (style.fontDescription().fontSynthesis() == FontSynthesisNone) … … 2073 2073 2074 2074 template<RenderStyleLengthGetter lengthGetter, RenderBoxComputedCSSValueGetter computedCSSValueGetter> 2075 inline RefPtr<CSSValue> zoomAdjustedPaddingOrMarginPixelValue( RenderStyle& style, RenderObject* renderer)2075 inline RefPtr<CSSValue> zoomAdjustedPaddingOrMarginPixelValue(const RenderStyle& style, RenderObject* renderer) 2076 2076 { 2077 2077 Length unzoomzedLength = (style.*lengthGetter)(); … … 2082 2082 2083 2083 template<RenderStyleLengthGetter lengthGetter> 2084 inline bool paddingOrMarginIsRendererDependent( RenderStyle* style, RenderObject* renderer)2084 inline bool paddingOrMarginIsRendererDependent(const RenderStyle* style, RenderObject* renderer) 2085 2085 { 2086 2086 if (!renderer || !renderer->isBox()) … … 2140 2140 #endif 2141 2141 2142 static bool isLayoutDependent(CSSPropertyID propertyID, RenderStyle* style, RenderObject* renderer)2142 static bool isLayoutDependent(CSSPropertyID propertyID, const RenderStyle* style, RenderObject* renderer) 2143 2143 { 2144 2144 switch (propertyID) { … … 2268 2268 } 2269 2269 2270 static inline RenderStyle* computeRenderStyleForProperty(Node* styledNode, PseudoId pseudoElementSpecifier, CSSPropertyID propertyID, std::unique_ptr<RenderStyle>& ownedStyle)2270 static inline const RenderStyle* computeRenderStyleForProperty(Node* styledNode, PseudoId pseudoElementSpecifier, CSSPropertyID propertyID, std::unique_ptr<RenderStyle>& ownedStyle) 2271 2271 { 2272 2272 RenderObject* renderer = styledNode->renderer(); … … 2374 2374 2375 2375 std::unique_ptr<RenderStyle> ownedStyle; 2376 RenderStyle* style = nullptr;2376 const RenderStyle* style = nullptr; 2377 2377 RenderObject* renderer = nullptr; 2378 2378 bool forceFullLayout = false; … … 3862 3862 return 0; 3863 3863 3864 RenderStyle* style = node->computedStyle(m_pseudoElementSpecifier);3864 auto* style = node->computedStyle(m_pseudoElementSpecifier); 3865 3865 if (!style) 3866 3866 return 0; … … 3881 3881 return emptyString(); 3882 3882 3883 RenderStyle* style = node->computedStyle(m_pseudoElementSpecifier);3883 auto* style = node->computedStyle(m_pseudoElementSpecifier); 3884 3884 if (!style) 3885 3885 return emptyString(); … … 3900 3900 if (propertyID == CSSPropertyFontSize && is<CSSPrimitiveValue>(*value) && m_node) { 3901 3901 m_node->document().updateLayoutIgnorePendingStylesheets(); 3902 if ( RenderStyle* style = m_node->computedStyle(m_pseudoElementSpecifier)) {3902 if (auto* style = m_node->computedStyle(m_pseudoElementSpecifier)) { 3903 3903 if (CSSValueID sizeIdentifier = style->fontDescription().keywordSizeAsIdentifier()) { 3904 3904 auto& primitiveValue = downcast<CSSPrimitiveValue>(*value); -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.h
r197563 r200098 71 71 72 72 RefPtr<CSSValue> svgPropertyValue(CSSPropertyID, EUpdateLayout) const; 73 RefPtr<SVGPaint> adjustSVGPaintForCurrentColor(PassRefPtr<SVGPaint>, RenderStyle*) const;73 RefPtr<SVGPaint> adjustSVGPaintForCurrentColor(PassRefPtr<SVGPaint>, const RenderStyle*) const; 74 74 75 75 static Ref<CSSValue> valueForShadow(const ShadowData*, CSSPropertyID, const RenderStyle&, AdjustPixelValuesForComputedStyle = AdjustPixelValues); 76 RefPtr<CSSPrimitiveValue> currentColorOrValidColor( RenderStyle*, const Color&) const;76 RefPtr<CSSPrimitiveValue> currentColorOrValidColor(const RenderStyle*, const Color&) const; 77 77 78 78 RefPtr<CSSValueList> getCSSPropertyValuesForShorthandProperties(const StylePropertyShorthand&) const; -
trunk/Source/WebCore/css/CSSToLengthConversionData.cpp
r169779 r200098 47 47 { 48 48 if (m_style && !m_computingFontSize) 49 m_style->setHasViewportUnits();49 const_cast<RenderStyle*>(m_style)->setHasViewportUnits(); 50 50 51 51 if (!m_renderView) … … 58 58 { 59 59 if (m_style && !m_computingFontSize) 60 m_style->setHasViewportUnits();60 const_cast<RenderStyle*>(m_style)->setHasViewportUnits(); 61 61 62 62 if (!m_renderView) … … 69 69 { 70 70 if (m_style && !m_computingFontSize) 71 m_style->setHasViewportUnits();71 const_cast<RenderStyle*>(m_style)->setHasViewportUnits(); 72 72 73 73 if (!m_renderView) … … 81 81 { 82 82 if (m_style && !m_computingFontSize) 83 m_style->setHasViewportUnits();83 const_cast<RenderStyle*>(m_style)->setHasViewportUnits(); 84 84 85 85 if (!m_renderView) -
trunk/Source/WebCore/css/CSSToLengthConversionData.h
r169779 r200098 42 42 class CSSToLengthConversionData { 43 43 public: 44 CSSToLengthConversionData( RenderStyle* style, const RenderStyle* rootStyle, const RenderView* renderView, float zoom, bool computingFontSize = false)44 CSSToLengthConversionData(const RenderStyle* style, const RenderStyle* rootStyle, const RenderView* renderView, float zoom, bool computingFontSize = false) 45 45 : m_style(style) 46 46 , m_rootStyle(rootStyle) … … 53 53 } 54 54 55 CSSToLengthConversionData( RenderStyle* style, const RenderStyle* rootStyle, const RenderView* renderView, bool computingFontSize = false)55 CSSToLengthConversionData(const RenderStyle* style, const RenderStyle* rootStyle, const RenderView* renderView, bool computingFontSize = false) 56 56 : m_style(style) 57 57 , m_rootStyle(rootStyle) … … 68 68 } 69 69 70 RenderStyle* style() const { return m_style; }70 const RenderStyle* style() const { return m_style; } 71 71 const RenderStyle* rootStyle() const { return m_rootStyle; } 72 72 float zoom() const; … … 84 84 85 85 private: 86 RenderStyle* m_style;86 const RenderStyle* m_style; 87 87 const RenderStyle* m_rootStyle; 88 88 const RenderView* m_renderView; -
trunk/Source/WebCore/css/CSSToStyleMap.cpp
r191151 r200098 57 57 } 58 58 59 RenderStyle* CSSToStyleMap::rootElementStyle() const59 const RenderStyle* CSSToStyleMap::rootElementStyle() const 60 60 { 61 61 return m_resolver->rootElementStyle(); -
trunk/Source/WebCore/css/CSSToStyleMap.h
r188315 r200098 82 82 // the current paint/layout. 83 83 RenderStyle* style() const; 84 RenderStyle* rootElementStyle() const;84 const RenderStyle* rootElementStyle() const; 85 85 bool useSVGZoomRules() const; 86 86 -
trunk/Source/WebCore/css/MediaQueryEvaluator.cpp
r199964 r200098 86 86 } 87 87 88 MediaQueryEvaluator::MediaQueryEvaluator(const String& acceptedMediaType, Frame* frame, RenderStyle* style)88 MediaQueryEvaluator::MediaQueryEvaluator(const String& acceptedMediaType, Frame* frame, const RenderStyle* style) 89 89 : m_mediaType(acceptedMediaType) 90 90 , m_frame(frame) 91 , m_style( WTFMove(style))91 , m_style(style) 92 92 , m_expResult(false) // doesn't matter when we have m_frame and m_style 93 93 { -
trunk/Source/WebCore/css/MediaQueryEvaluator.h
r199964 r200098 81 81 /** Creates evaluator which evaluates full media queries 82 82 */ 83 MediaQueryEvaluator(const String& acceptedMediaType, Frame*, RenderStyle*);83 MediaQueryEvaluator(const String& acceptedMediaType, Frame*, const RenderStyle*); 84 84 85 85 ~MediaQueryEvaluator(); … … 100 100 String m_mediaType; 101 101 Frame* m_frame { nullptr }; // not owned 102 RenderStyle* m_style { nullptr };102 const RenderStyle* m_style { nullptr }; 103 103 bool m_expResult; 104 104 }; -
trunk/Source/WebCore/css/SVGCSSComputedStyleDeclaration.cpp
r194496 r200098 94 94 } 95 95 96 RefPtr<SVGPaint> ComputedStyleExtractor::adjustSVGPaintForCurrentColor(PassRefPtr<SVGPaint> newPaint, RenderStyle* style) const96 RefPtr<SVGPaint> ComputedStyleExtractor::adjustSVGPaintForCurrentColor(PassRefPtr<SVGPaint> newPaint, const RenderStyle* style) const 97 97 { 98 98 RefPtr<SVGPaint> paint = newPaint; … … 112 112 node->document().updateLayout(); 113 113 114 RenderStyle* style = node->computedStyle();114 auto* style = node->computedStyle(); 115 115 if (!style) 116 116 return nullptr; -
trunk/Source/WebCore/css/SourceSizeList.cpp
r197456 r200098 33 33 namespace WebCore { 34 34 35 static bool match(std::unique_ptr<MediaQueryExp>&& expression, RenderStyle& style, Frame* frame)35 static bool match(std::unique_ptr<MediaQueryExp>&& expression, const RenderStyle& style, Frame* frame) 36 36 { 37 37 if (expression->mediaFeature().isEmpty()) … … 48 48 } 49 49 50 static float defaultLength( RenderStyle& style, RenderView* view)50 static float defaultLength(const RenderStyle& style, RenderView* view) 51 51 { 52 52 return clampTo<float>(CSSPrimitiveValue::computeNonCalcLengthDouble(CSSToLengthConversionData(&style, &style, view), CSSPrimitiveValue::CSS_VW, 100.0)); 53 53 } 54 54 55 static float computeLength(CSSValue* value, RenderStyle& style, RenderView* view)55 static float computeLength(CSSValue* value, const RenderStyle& style, RenderView* view) 56 56 { 57 57 CSSToLengthConversionData conversionData(&style, &style, view); … … 71 71 if (!view) 72 72 return 0; 73 RenderStyle& style = view->style();73 auto& style = view->style(); 74 74 for (auto& sourceSize : CSSParser(CSSStrictMode).parseSizesAttribute(sizesAttribute)) { 75 75 if (match(WTFMove(sourceSize.expression), style, frame)) -
trunk/Source/WebCore/css/StyleBuilderCustom.h
r199625 r200098 576 576 577 577 private: 578 static const NinePieceImage& getValue( RenderStyle* style)578 static const NinePieceImage& getValue(const RenderStyle* style) 579 579 { 580 580 return type == BorderImage ? style->borderImage() : style->maskBoxImage(); … … 665 665 inline void StyleBuilderCustom::applyInheritClip(StyleResolver& styleResolver) 666 666 { 667 RenderStyle* parentStyle = styleResolver.parentStyle();667 auto* parentStyle = styleResolver.parentStyle(); 668 668 if (!parentStyle->hasClip()) 669 669 return applyInitialClip(styleResolver); … … 1053 1053 { 1054 1054 CounterDirectiveMap& map = styleResolver.style()->accessCounterDirectives(); 1055 for (auto& keyValue : styleResolver.parentStyle()->accessCounterDirectives()) {1055 for (auto& keyValue : const_cast<RenderStyle*>(styleResolver.parentStyle())->accessCounterDirectives()) { 1056 1056 CounterDirectives& directives = map.add(keyValue.key, CounterDirectives()).iterator->value; 1057 1057 if (counterBehavior == Reset) … … 1338 1338 styleResolver.style()->setUnique(); 1339 1339 else 1340 styleResolver.parentStyle()->setUnique();1340 const_cast<RenderStyle*>(styleResolver.parentStyle())->setUnique(); 1341 1341 QualifiedName attr(nullAtom, contentValue.getStringValue().impl(), nullAtom); 1342 1342 const AtomicString& value = styleResolver.element()->getAttribute(attr); … … 1707 1707 styleResolver.style()->setUnique(); 1708 1708 else 1709 styleResolver.parentStyle()->setUnique();1709 const_cast<RenderStyle*>(styleResolver.parentStyle())->setUnique(); 1710 1710 1711 1711 QualifiedName attr(nullAtom, primitiveValue.getStringValue(), nullAtom); -
trunk/Source/WebCore/css/StyleResolver.cpp
r200041 r200098 337 337 } 338 338 339 StyleResolver::State::State(const Element& element, RenderStyle* parentStyle,RenderStyle* documentElementStyle, const RenderRegion* regionForStyling, const SelectorFilter* selectorFilter)339 StyleResolver::State::State(const Element& element, const RenderStyle* parentStyle, const RenderStyle* documentElementStyle, const RenderRegion* regionForStyling, const SelectorFilter* selectorFilter) 340 340 : m_element(&element) 341 341 , m_parentStyle(parentStyle) … … 381 381 } 382 382 383 ElementStyle StyleResolver::styleForElement(const Element& element, RenderStyle* parentStyle, RuleMatchingBehavior matchingBehavior, const RenderRegion* regionForStyling, const SelectorFilter* selectorFilter)383 ElementStyle StyleResolver::styleForElement(const Element& element, const RenderStyle* parentStyle, RuleMatchingBehavior matchingBehavior, const RenderRegion* regionForStyling, const SelectorFilter* selectorFilter) 384 384 { 385 385 RELEASE_ASSERT(!m_inLoadPendingImages); … … 559 559 } 560 560 561 std::unique_ptr<RenderStyle> StyleResolver::pseudoStyleForElement(const Element& element, const PseudoStyleRequest& pseudoStyleRequest, RenderStyle& parentStyle)561 std::unique_ptr<RenderStyle> StyleResolver::pseudoStyleForElement(const Element& element, const PseudoStyleRequest& pseudoStyleRequest, const RenderStyle& parentStyle) 562 562 { 563 563 m_state = State(element, &parentStyle); … … 1632 1632 1633 1633 if (isInherit && !state.parentStyle()->hasExplicitlyInheritedProperties() && !CSSProperty::isInheritedProperty(id)) 1634 state.parentStyle()->setHasExplicitlyInheritedProperties();1634 const_cast<RenderStyle*>(state.parentStyle())->setHasExplicitlyInheritedProperties(); 1635 1635 1636 1636 if (id == CSSPropertyCustom) { … … 1735 1735 #endif 1736 1736 1737 void StyleResolver::checkForZoomChange(RenderStyle* style, RenderStyle* parentStyle)1737 void StyleResolver::checkForZoomChange(RenderStyle* style, const RenderStyle* parentStyle) 1738 1738 { 1739 1739 if (!parentStyle) … … 1749 1749 } 1750 1750 1751 void StyleResolver::checkForGenericFamilyChange(RenderStyle* style, RenderStyle* parentStyle)1751 void StyleResolver::checkForGenericFamilyChange(RenderStyle* style, const RenderStyle* parentStyle) 1752 1752 { 1753 1753 const auto& childFont = style->fontDescription(); -
trunk/Source/WebCore/css/StyleResolver.h
r199964 r200098 142 142 ~StyleResolver(); 143 143 144 ElementStyle styleForElement(const Element&, RenderStyle* parentStyle, RuleMatchingBehavior = MatchAllRules, const RenderRegion* regionForStyling = nullptr, const SelectorFilter* = nullptr);144 ElementStyle styleForElement(const Element&, const RenderStyle* parentStyle, RuleMatchingBehavior = MatchAllRules, const RenderRegion* regionForStyling = nullptr, const SelectorFilter* = nullptr); 145 145 146 146 void keyframeStylesForAnimation(const Element&, const RenderStyle*, KeyframeList&); 147 147 148 std::unique_ptr<RenderStyle> pseudoStyleForElement(const Element&, const PseudoStyleRequest&, RenderStyle& parentStyle);148 std::unique_ptr<RenderStyle> pseudoStyleForElement(const Element&, const PseudoStyleRequest&, const RenderStyle& parentStyle); 149 149 150 150 std::unique_ptr<RenderStyle> styleForPage(int pageIndex); … … 152 152 153 153 RenderStyle* style() const { return m_state.style(); } 154 RenderStyle* parentStyle() const { return m_state.parentStyle(); }155 RenderStyle* rootElementStyle() const { return m_state.rootElementStyle(); }154 const RenderStyle* parentStyle() const { return m_state.parentStyle(); } 155 const RenderStyle* rootElementStyle() const { return m_state.rootElementStyle(); } 156 156 const Element* element() { return m_state.element(); } 157 157 Document& document() { return m_document; } … … 318 318 private: 319 319 // This function fixes up the default font size if it detects that the current generic font family has changed. -dwh 320 void checkForGenericFamilyChange(RenderStyle*, RenderStyle* parentStyle);321 void checkForZoomChange(RenderStyle*, RenderStyle* parentStyle);320 void checkForGenericFamilyChange(RenderStyle*, const RenderStyle* parentStyle); 321 void checkForZoomChange(RenderStyle*, const RenderStyle* parentStyle); 322 322 #if ENABLE(IOS_TEXT_AUTOSIZING) 323 323 void checkForTextSizeAdjust(RenderStyle*); … … 362 362 public: 363 363 State() { } 364 State(const Element&, RenderStyle* parentStyle,RenderStyle* documentElementStyle = nullptr, const RenderRegion* regionForStyling = nullptr, const SelectorFilter* = nullptr);364 State(const Element&, const RenderStyle* parentStyle, const RenderStyle* documentElementStyle = nullptr, const RenderRegion* regionForStyling = nullptr, const SelectorFilter* = nullptr); 365 365 366 366 public: … … 375 375 376 376 void setParentStyle(std::unique_ptr<RenderStyle>); 377 RenderStyle* parentStyle() const { return m_parentStyle; }378 RenderStyle* rootElementStyle() const { return m_rootElementStyle; }377 const RenderStyle* parentStyle() const { return m_parentStyle; } 378 const RenderStyle* rootElementStyle() const { return m_rootElementStyle; } 379 379 380 380 const RenderRegion* regionForStyling() const { return m_regionForStyling; } … … 428 428 const Element* m_element { nullptr }; 429 429 std::unique_ptr<RenderStyle> m_style; 430 RenderStyle* m_parentStyle { nullptr };430 const RenderStyle* m_parentStyle { nullptr }; 431 431 std::unique_ptr<RenderStyle> m_ownedParentStyle; 432 RenderStyle* m_rootElementStyle { nullptr };432 const RenderStyle* m_rootElementStyle { nullptr }; 433 433 434 434 const RenderRegion* m_regionForStyling { nullptr }; -
trunk/Source/WebCore/dom/Document.cpp
r200075 r200098 2005 2005 } 2006 2006 2007 std::unique_ptr<RenderStyle> Document::styleForElementIgnoringPendingStylesheets(Element& element, RenderStyle* parentStyle)2007 std::unique_ptr<RenderStyle> Document::styleForElementIgnoringPendingStylesheets(Element& element, const RenderStyle* parentStyle) 2008 2008 { 2009 2009 ASSERT(&element.document() == this); … … 2512 2512 m_visuallyOrdered = true; 2513 2513 if (renderView()) 2514 renderView()-> style().setRTLOrdering(VisualOrder);2514 renderView()->mutableStyle().setRTLOrdering(VisualOrder); 2515 2515 } 2516 2516 -
trunk/Source/WebCore/dom/Document.h
r200075 r200098 572 572 WEBCORE_EXPORT void updateLayoutIgnorePendingStylesheets(RunPostLayoutTasks = RunPostLayoutTasks::Asynchronously); 573 573 574 std::unique_ptr<RenderStyle> styleForElementIgnoringPendingStylesheets(Element&, RenderStyle* parentStyle);574 std::unique_ptr<RenderStyle> styleForElementIgnoringPendingStylesheets(Element&, const RenderStyle* parentStyle); 575 575 576 576 // Returns true if page box (margin boxes and page borders) is visible. -
trunk/Source/WebCore/dom/Element.cpp
r200075 r200098 1371 1371 } 1372 1372 1373 ElementStyle Element::resolveStyle( RenderStyle* parentStyle)1373 ElementStyle Element::resolveStyle(const RenderStyle* parentStyle) 1374 1374 { 1375 1375 return styleResolver().styleForElement(*this, parentStyle); … … 1759 1759 { 1760 1760 if (element.styleAffectedByEmpty()) { 1761 RenderStyle* style = element.renderStyle();1761 auto* style = element.renderStyle(); 1762 1762 if (!style || (!style->emptyState() || element.hasChildNodes())) 1763 1763 element.setNeedsStyleRecalc(); … … 1785 1785 // This is the insert/append case. 1786 1786 if (newFirstElement != elementAfterChange) { 1787 RenderStyle* style = elementAfterChange->renderStyle();1787 auto* style = elementAfterChange->renderStyle(); 1788 1788 if (!style || style->firstChildState()) 1789 1789 elementAfterChange->setNeedsStyleRecalc(); … … 1792 1792 // We also have to handle node removal. 1793 1793 if (checkType == SiblingElementRemoved && newFirstElement == elementAfterChange && newFirstElement) { 1794 RenderStyle* style = newFirstElement->renderStyle();1794 auto* style = newFirstElement->renderStyle(); 1795 1795 if (!style || !style->firstChildState()) 1796 1796 newFirstElement->setNeedsStyleRecalc(); … … 1805 1805 1806 1806 if (newLastElement != elementBeforeChange) { 1807 RenderStyle* style = elementBeforeChange->renderStyle();1807 auto* style = elementBeforeChange->renderStyle(); 1808 1808 if (!style || style->lastChildState()) 1809 1809 elementBeforeChange->setNeedsStyleRecalc(); … … 1813 1813 // to match now. 1814 1814 if ((checkType == SiblingElementRemoved || checkType == FinishedParsingChildren) && newLastElement == elementBeforeChange && newLastElement) { 1815 RenderStyle* style = newLastElement->renderStyle();1815 auto* style = newLastElement->renderStyle(); 1816 1816 if (!style || !style->lastChildState()) 1817 1817 newLastElement->setNeedsStyleRecalc(); … … 2460 2460 } 2461 2461 2462 RenderStyle* Element::existingComputedStyle()2462 const RenderStyle* Element::existingComputedStyle() 2463 2463 { 2464 2464 if (auto* renderTreeStyle = renderStyle()) … … 2471 2471 } 2472 2472 2473 RenderStyle& Element::resolveComputedStyle()2473 const RenderStyle& Element::resolveComputedStyle() 2474 2474 { 2475 2475 ASSERT(inDocument()); … … 2477 2477 2478 2478 Deque<Element*, 32> elementsRequiringComputedStyle({ this }); 2479 RenderStyle* computedStyle = nullptr;2479 const RenderStyle* computedStyle = nullptr; 2480 2480 2481 2481 // Collect ancestors until we find one that has style. … … 2500 2500 } 2501 2501 2502 RenderStyle* Element::computedStyle(PseudoId pseudoElementSpecifier)2502 const RenderStyle* Element::computedStyle(PseudoId pseudoElementSpecifier) 2503 2503 { 2504 2504 if (PseudoElement* pseudoElement = beforeOrAfterPseudoElement(*this, pseudoElementSpecifier)) … … 3294 3294 } 3295 3295 3296 Optional<ElementStyle> Element::resolveCustomStyle( RenderStyle&,RenderStyle*)3296 Optional<ElementStyle> Element::resolveCustomStyle(const RenderStyle&, const RenderStyle*) 3297 3297 { 3298 3298 ASSERT(hasCustomStyleResolveCallbacks()); -
trunk/Source/WebCore/dom/Element.h
r200041 r200098 280 280 virtual Element* focusDelegate(); 281 281 282 RenderStyle* computedStyle(PseudoId = NOPSEUDO) override;282 const RenderStyle* computedStyle(PseudoId = NOPSEUDO) override; 283 283 284 284 bool needsStyleInvalidation() const; … … 481 481 virtual void willDetachRenderers(); 482 482 virtual void didDetachRenderers(); 483 virtual Optional<ElementStyle> resolveCustomStyle( RenderStyle& parentStyle,RenderStyle* shadowHostStyle);483 virtual Optional<ElementStyle> resolveCustomStyle(const RenderStyle& parentStyle, const RenderStyle* shadowHostStyle); 484 484 485 485 LayoutRect absoluteEventHandlerBounds(bool& includesFixedPositionElements) override; … … 500 500 501 501 StyleResolver& styleResolver(); 502 ElementStyle resolveStyle( RenderStyle* parentStyle);502 ElementStyle resolveStyle(const RenderStyle* parentStyle); 503 503 504 504 bool hasDisplayContents() const; … … 593 593 void removeShadowRoot(); 594 594 595 RenderStyle* existingComputedStyle();596 RenderStyle& resolveComputedStyle();595 const RenderStyle* existingComputedStyle(); 596 const RenderStyle& resolveComputedStyle(); 597 597 598 598 bool rareDataStyleAffectedByEmpty() const; -
trunk/Source/WebCore/dom/Node.cpp
r200075 r200098 660 660 661 661 for (const Node* node = &startNode; node; node = node->parentNode()) { 662 RenderStyle* style = node->isDocumentNode() ? node->renderStyle() : const_cast<Node*>(node)->computedStyle();662 auto* style = node->isDocumentNode() ? node->renderStyle() : const_cast<Node*>(node)->computedStyle(); 663 663 if (!style) 664 664 continue; … … 1007 1007 } 1008 1008 1009 RenderStyle* Node::computedStyle(PseudoId pseudoElementSpecifier)1009 const RenderStyle* Node::computedStyle(PseudoId pseudoElementSpecifier) 1010 1010 { 1011 1011 auto* composedParent = composedTreeAncestors(*this).first(); -
trunk/Source/WebCore/dom/Node.h
r199385 r200098 444 444 445 445 // Wrapper for nodes that don't have a renderer, but still cache the style (like HTMLOptionElement). 446 RenderStyle* renderStyle() const;447 448 virtual RenderStyle* computedStyle(PseudoId pseudoElementSpecifier = NOPSEUDO);446 const RenderStyle* renderStyle() const; 447 448 virtual const RenderStyle* computedStyle(PseudoId pseudoElementSpecifier = NOPSEUDO); 449 449 450 450 // ----------------------------------------------------------------------------- -
trunk/Source/WebCore/dom/NodeRenderStyle.h
r172591 r200098 33 33 namespace WebCore { 34 34 35 inline RenderStyle* Node::renderStyle() const35 inline const RenderStyle* Node::renderStyle() const 36 36 { 37 37 auto* renderer = this->renderer(); -
trunk/Source/WebCore/dom/PseudoElement.cpp
r200041 r200098 78 78 } 79 79 80 Optional<ElementStyle> PseudoElement::resolveCustomStyle( RenderStyle& parentStyle,RenderStyle*)80 Optional<ElementStyle> PseudoElement::resolveCustomStyle(const RenderStyle& parentStyle, const RenderStyle*) 81 81 { 82 82 auto* style = m_hostElement->renderer()->getCachedPseudoStyle(m_pseudoId, &parentStyle); -
trunk/Source/WebCore/dom/PseudoElement.h
r197764 r200098 46 46 void clearHostElement(); 47 47 48 Optional<ElementStyle> resolveCustomStyle( RenderStyle& parentStyle,RenderStyle* shadowHostStyle) override;48 Optional<ElementStyle> resolveCustomStyle(const RenderStyle& parentStyle, const RenderStyle* shadowHostStyle) override; 49 49 void didAttachRenderers() override; 50 50 void didRecalcStyle(Style::Change) override; -
trunk/Source/WebCore/editing/ApplyBlockElementCommand.cpp
r192567 r200098 180 180 } 181 181 182 RenderStyle* ApplyBlockElementCommand::renderStyleOfEnclosingTextNode(const Position& position)182 const RenderStyle* ApplyBlockElementCommand::renderStyleOfEnclosingTextNode(const Position& position) 183 183 { 184 184 if (position.anchorType() != Position::PositionIsOffsetInAnchor 185 185 || !position.containerNode() 186 186 || !position.containerNode()->isTextNode()) 187 return 0;187 return nullptr; 188 188 189 189 document().updateStyleIfNeeded(); … … 191 191 RenderObject* renderer = position.containerNode()->renderer(); 192 192 if (!renderer) 193 return 0;193 return nullptr; 194 194 195 195 return &renderer->style(); … … 202 202 203 203 bool isStartAndEndOnSameNode = false; 204 if ( RenderStyle* startStyle = renderStyleOfEnclosingTextNode(start)) {204 if (auto* startStyle = renderStyleOfEnclosingTextNode(start)) { 205 205 isStartAndEndOnSameNode = renderStyleOfEnclosingTextNode(end) && start.containerNode() == end.containerNode(); 206 206 bool isStartAndEndOfLastParagraphOnSameNode = renderStyleOfEnclosingTextNode(m_endOfLastParagraph) && start.containerNode() == m_endOfLastParagraph.containerNode(); … … 227 227 } 228 228 229 if ( RenderStyle* endStyle = renderStyleOfEnclosingTextNode(end)) {229 if (auto* endStyle = renderStyleOfEnclosingTextNode(end)) { 230 230 bool isEndAndEndOfLastParagraphOnSameNode = renderStyleOfEnclosingTextNode(m_endOfLastParagraph) && end.deprecatedNode() == m_endOfLastParagraph.deprecatedNode(); 231 231 // Include \n at the end of line if we're at an empty paragraph … … 259 259 VisiblePosition endOfNextParagraph = endOfParagraph(endOfCurrentParagraph.next()); 260 260 Position position = endOfNextParagraph.deepEquivalent(); 261 RenderStyle* style = renderStyleOfEnclosingTextNode(position);261 auto* style = renderStyleOfEnclosingTextNode(position); 262 262 if (!style) 263 263 return endOfNextParagraph; -
trunk/Source/WebCore/editing/ApplyBlockElementCommand.h
r197563 r200098 49 49 void doApply() override; 50 50 virtual void formatRange(const Position& start, const Position& end, const Position& endOfSelection, RefPtr<Element>&) = 0; 51 RenderStyle* renderStyleOfEnclosingTextNode(const Position&);51 const RenderStyle* renderStyleOfEnclosingTextNode(const Position&); 52 52 void rangeForParagraphSplittingTextNodesIfNeeded(const VisiblePosition&, Position&, Position&); 53 53 VisiblePosition endOfNextParagraphSplittingTextNodesIfNeeded(VisiblePosition&, Position&, Position&); -
trunk/Source/WebCore/editing/EditingStyle.cpp
r197591 r200098 462 462 463 463 if (node && node->computedStyle()) { 464 RenderStyle* renderStyle = node->computedStyle();464 auto* renderStyle = node->computedStyle(); 465 465 removeTextFillAndStrokeColorsIfNeeded(renderStyle); 466 466 if (renderStyle->fontDescription().keywordSize()) … … 472 472 } 473 473 474 void EditingStyle::removeTextFillAndStrokeColorsIfNeeded( RenderStyle* renderStyle)474 void EditingStyle::removeTextFillAndStrokeColorsIfNeeded(const RenderStyle* renderStyle) 475 475 { 476 476 // If a node's text fill color is invalid, then its children use -
trunk/Source/WebCore/editing/EditingStyle.h
r191671 r200098 179 179 EditingStyle(CSSPropertyID, CSSValueID); 180 180 void init(Node*, PropertiesToInclude); 181 void removeTextFillAndStrokeColorsIfNeeded( RenderStyle*);181 void removeTextFillAndStrokeColorsIfNeeded(const RenderStyle*); 182 182 void setProperty(CSSPropertyID, const String& value, bool important = false); 183 183 void extractFontSizeDelta(); -
trunk/Source/WebCore/editing/Editor.h
r199030 r200098 431 431 432 432 #if PLATFORM(COCOA) 433 WEBCORE_EXPORT static RenderStyle* styleForSelectionStart(Frame* , Node *&nodeToRemove);434 void getTextDecorationAttributesRespectingTypingStyle( RenderStyle&, NSMutableDictionary*) const;433 WEBCORE_EXPORT static const RenderStyle* styleForSelectionStart(Frame* , Node *&nodeToRemove); 434 void getTextDecorationAttributesRespectingTypingStyle(const RenderStyle&, NSMutableDictionary*) const; 435 435 WEBCORE_EXPORT const Font* fontForSelection(bool&) const; 436 436 WEBCORE_EXPORT NSDictionary *fontAttributesForSelectionStart() const; -
trunk/Source/WebCore/editing/SimplifyMarkupCommand.cpp
r179143 r200098 58 58 59 59 Node* startingNode = node->parentNode(); 60 RenderStyle* startingStyle = startingNode->renderStyle();60 auto* startingStyle = startingNode->renderStyle(); 61 61 if (!startingStyle) 62 62 continue; -
trunk/Source/WebCore/editing/cocoa/EditorCocoa.mm
r192285 r200098 42 42 43 43 // FIXME: This figures out the current style by inserting a <span>! 44 RenderStyle* Editor::styleForSelectionStart(Frame* frame, Node *&nodeToRemove)44 const RenderStyle* Editor::styleForSelectionStart(Frame* frame, Node *&nodeToRemove) 45 45 { 46 46 nodeToRemove = nullptr; … … 77 77 } 78 78 79 void Editor::getTextDecorationAttributesRespectingTypingStyle( RenderStyle& style, NSMutableDictionary* result) const79 void Editor::getTextDecorationAttributesRespectingTypingStyle(const RenderStyle& style, NSMutableDictionary* result) const 80 80 { 81 81 RefPtr<EditingStyle> typingStyle = m_frame.selection().typingStyle(); -
trunk/Source/WebCore/editing/ios/EditorIOS.mm
r198177 r200098 182 182 if (!m_frame.selection().isRange()) { 183 183 Node* nodeToRemove; 184 RenderStyle* style = styleForSelectionStart(&m_frame, nodeToRemove); // sets nodeToRemove184 auto* style = styleForSelectionStart(&m_frame, nodeToRemove); // sets nodeToRemove 185 185 186 186 const Font* result = nullptr; … … 221 221 { 222 222 Node* nodeToRemove; 223 RenderStyle* style = styleForSelectionStart(&m_frame, nodeToRemove);223 auto* style = styleForSelectionStart(&m_frame, nodeToRemove); 224 224 if (!style) 225 225 return nil; -
trunk/Source/WebCore/editing/mac/EditorMac.mm
r199817 r200098 108 108 if (!m_frame.selection().isRange()) { 109 109 Node* nodeToRemove; 110 RenderStyle* style = styleForSelectionStart(&m_frame, nodeToRemove); // sets nodeToRemove110 auto* style = styleForSelectionStart(&m_frame, nodeToRemove); // sets nodeToRemove 111 111 112 112 const Font* result = nullptr; … … 147 147 { 148 148 Node* nodeToRemove; 149 RenderStyle* style = styleForSelectionStart(&m_frame, nodeToRemove);149 auto* style = styleForSelectionStart(&m_frame, nodeToRemove); 150 150 if (!style) 151 151 return nil; -
trunk/Source/WebCore/html/HTMLTitleElement.cpp
r199964 r200098 80 80 { 81 81 TextDirection direction = LTR; 82 if ( RenderStyle* computedStyle = this->computedStyle())82 if (auto* computedStyle = this->computedStyle()) 83 83 direction = computedStyle->direction(); 84 84 else { -
trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp
r200058 r200098 321 321 } 322 322 323 inline void CanvasRenderingContext2D::FontProxy::initialize(FontSelector& fontSelector, RenderStyle& newStyle)323 inline void CanvasRenderingContext2D::FontProxy::initialize(FontSelector& fontSelector, const RenderStyle& newStyle) 324 324 { 325 325 // Beware! m_font.fontSelector() might not point to document.fontSelector()! … … 2197 2197 document.updateStyleIfNeeded(); 2198 2198 2199 if ( RenderStyle* computedStyle = canvas()->computedStyle())2199 if (auto* computedStyle = canvas()->computedStyle()) 2200 2200 newStyle->setFontDescription(computedStyle->fontDescription()); 2201 2201 else { … … 2260 2260 } 2261 2261 2262 inline TextDirection CanvasRenderingContext2D::toTextDirection(Direction direction, RenderStyle** computedStyle) const2263 { 2264 RenderStyle* style = (computedStyle || direction == Direction::Inherit) ? canvas()->computedStyle() : nullptr;2262 inline TextDirection CanvasRenderingContext2D::toTextDirection(Direction direction, const RenderStyle** computedStyle) const 2263 { 2264 auto* style = (computedStyle || direction == Direction::Inherit) ? canvas()->computedStyle() : nullptr; 2265 2265 if (computedStyle) 2266 2266 *computedStyle = style; … … 2385 2385 // FIXME: Need to turn off font smoothing. 2386 2386 2387 RenderStyle* computedStyle;2387 const RenderStyle* computedStyle; 2388 2388 TextDirection direction = toTextDirection(state().direction, &computedStyle); 2389 2389 bool isRTL = direction == RTL; -
trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.h
r200058 r200098 256 256 257 257 bool realized() const { return m_font.fontSelector(); } 258 void initialize(FontSelector&, RenderStyle&);258 void initialize(FontSelector&, const RenderStyle&); 259 259 FontMetrics fontMetrics() const; 260 260 const FontCascadeDescription& fontDescription() const; … … 383 383 384 384 bool hasInvertibleTransform() const override { return state().hasInvertibleTransform; } 385 TextDirection toTextDirection(Direction, RenderStyle** computedStyle = nullptr) const;385 TextDirection toTextDirection(Direction, const RenderStyle** computedStyle = nullptr) const; 386 386 387 387 #if ENABLE(ACCELERATED_2D_CANVAS) -
trunk/Source/WebCore/html/parser/HTMLResourcePreloader.cpp
r194496 r200098 59 59 } 60 60 61 static bool mediaAttributeMatches(Frame* frame, RenderStyle* renderStyle, const String& attributeValue)61 static bool mediaAttributeMatches(Frame* frame, const RenderStyle* renderStyle, const String& attributeValue) 62 62 { 63 63 RefPtr<MediaQuerySet> mediaQueries = MediaQuerySet::createAllowingDescriptionSyntax(attributeValue); -
trunk/Source/WebCore/html/shadow/SliderThumbElement.cpp
r200041 r200098 84 84 } 85 85 86 void RenderSliderThumb::updateAppearance( RenderStyle* parentStyle)86 void RenderSliderThumb::updateAppearance(const RenderStyle* parentStyle) 87 87 { 88 88 if (parentStyle->appearance() == SliderVerticalPart) 89 style().setAppearance(SliderThumbVerticalPart);89 mutableStyle().setAppearance(SliderThumbVerticalPart); 90 90 else if (parentStyle->appearance() == SliderHorizontalPart) 91 style().setAppearance(SliderThumbHorizontalPart);91 mutableStyle().setAppearance(SliderThumbHorizontalPart); 92 92 else if (parentStyle->appearance() == MediaSliderPart) 93 style().setAppearance(MediaSliderThumbPart);93 mutableStyle().setAppearance(MediaSliderThumbPart); 94 94 else if (parentStyle->appearance() == MediaVolumeSliderPart) 95 style().setAppearance(MediaVolumeSliderThumbPart);95 mutableStyle().setAppearance(MediaVolumeSliderThumbPart); 96 96 else if (parentStyle->appearance() == MediaFullScreenVolumeSliderPart) 97 style().setAppearance(MediaFullScreenVolumeSliderThumbPart);97 mutableStyle().setAppearance(MediaFullScreenVolumeSliderThumbPart); 98 98 if (style().hasAppearance()) { 99 99 ASSERT(element()); 100 theme().adjustSliderThumbSize( style(), element());100 theme().adjustSliderThumbSize(mutableStyle(), element()); 101 101 } 102 102 } … … 160 160 auto& input = downcast<HTMLInputElement>(*element()->shadowHost()); 161 161 bool isVertical = hasVerticalAppearance(input); 162 style().setFlexDirection(isVertical ? FlowColumn : FlowRow);162 mutableStyle().setFlexDirection(isVertical ? FlowColumn : FlowRow); 163 163 TextDirection oldTextDirection = style().direction(); 164 164 if (isVertical) { … … 166 166 // render identically to LTR vertical sliders. We can remove this work around when 167 167 // subpixel rendering is enabled on all ports. 168 style().setDirection(LTR);168 mutableStyle().setDirection(LTR); 169 169 } 170 170 … … 178 178 RenderFlexibleBox::layout(); 179 179 180 style().setDirection(oldTextDirection);180 mutableStyle().setDirection(oldTextDirection); 181 181 // These should always exist, unless someone mutates the shadow DOM (e.g., in the inspector). 182 182 if (!thumb || !track) … … 575 575 } 576 576 577 Optional<ElementStyle> SliderThumbElement::resolveCustomStyle( RenderStyle&,RenderStyle* hostStyle)577 Optional<ElementStyle> SliderThumbElement::resolveCustomStyle(const RenderStyle&, const RenderStyle* hostStyle) 578 578 { 579 579 // This doesn't actually compute style. This is just a hack to pick shadow pseudo id when host style is known. … … 629 629 } 630 630 631 Optional<ElementStyle> SliderContainerElement::resolveCustomStyle( RenderStyle&,RenderStyle* hostStyle)631 Optional<ElementStyle> SliderContainerElement::resolveCustomStyle(const RenderStyle&, const RenderStyle* hostStyle) 632 632 { 633 633 // This doesn't actually compute style. This is just a hack to pick shadow pseudo id when host style is known. -
trunk/Source/WebCore/html/shadow/SliderThumbElement.h
r200041 r200098 79 79 void willDetachRenderers() override; 80 80 81 Optional<ElementStyle> resolveCustomStyle( RenderStyle&,RenderStyle*) override;81 Optional<ElementStyle> resolveCustomStyle(const RenderStyle&, const RenderStyle*) override; 82 82 const AtomicString& shadowPseudoId() const override; 83 83 … … 121 121 public: 122 122 RenderSliderThumb(SliderThumbElement&, RenderStyle&&); 123 void updateAppearance( RenderStyle* parentStyle);123 void updateAppearance(const RenderStyle* parentStyle); 124 124 125 125 private: … … 136 136 SliderContainerElement(Document&); 137 137 RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) override; 138 Optional<ElementStyle> resolveCustomStyle( RenderStyle&,RenderStyle*) override;138 Optional<ElementStyle> resolveCustomStyle(const RenderStyle&, const RenderStyle*) override; 139 139 const AtomicString& shadowPseudoId() const override; 140 140 -
trunk/Source/WebCore/html/shadow/TextControlInnerElements.cpp
r200041 r200098 76 76 } 77 77 78 Optional<ElementStyle> TextControlInnerElement::resolveCustomStyle( RenderStyle&,RenderStyle* shadowHostStyle)78 Optional<ElementStyle> TextControlInnerElement::resolveCustomStyle(const RenderStyle&, const RenderStyle* shadowHostStyle) 79 79 { 80 80 auto innerContainerStyle = RenderStyle::createPtr(); … … 135 135 } 136 136 137 Optional<ElementStyle> TextControlInnerTextElement::resolveCustomStyle( RenderStyle&,RenderStyle* shadowHostStyle)137 Optional<ElementStyle> TextControlInnerTextElement::resolveCustomStyle(const RenderStyle&, const RenderStyle* shadowHostStyle) 138 138 { 139 139 auto style = downcast<HTMLTextFormControlElement>(*shadowHost()).createInnerTextStyle(*shadowHostStyle); … … 150 150 } 151 151 152 Optional<ElementStyle> TextControlPlaceholderElement::resolveCustomStyle( RenderStyle& parentStyle,RenderStyle* shadowHostStyle)152 Optional<ElementStyle> TextControlPlaceholderElement::resolveCustomStyle(const RenderStyle& parentStyle, const RenderStyle* shadowHostStyle) 153 153 { 154 154 auto style = resolveStyle(&parentStyle); -
trunk/Source/WebCore/html/shadow/TextControlInnerElements.h
r200041 r200098 49 49 protected: 50 50 TextControlInnerElement(Document&); 51 Optional<ElementStyle> resolveCustomStyle( RenderStyle& parentStyle,RenderStyle* shadowHostStyle) override;51 Optional<ElementStyle> resolveCustomStyle(const RenderStyle& parentStyle, const RenderStyle* shadowHostStyle) override; 52 52 53 53 private: … … 66 66 TextControlInnerTextElement(Document&); 67 67 RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) override; 68 Optional<ElementStyle> resolveCustomStyle( RenderStyle& parentStyle,RenderStyle* shadowHostStyle) override;68 Optional<ElementStyle> resolveCustomStyle(const RenderStyle& parentStyle, const RenderStyle* shadowHostStyle) override; 69 69 bool isMouseFocusable() const override { return false; } 70 70 bool isTextControlInnerTextElement() const override { return true; } … … 78 78 TextControlPlaceholderElement(Document&); 79 79 80 Optional<ElementStyle> resolveCustomStyle( RenderStyle& parentStyle,RenderStyle* shadowHostStyle) override;80 Optional<ElementStyle> resolveCustomStyle(const RenderStyle& parentStyle, const RenderStyle* shadowHostStyle) override; 81 81 }; 82 82 -
trunk/Source/WebCore/page/EventHandler.cpp
r199817 r200098 1382 1382 1383 1383 auto renderer = node->renderer(); 1384 RenderStyle* style = renderer ? &renderer->style() : nullptr;1384 auto* style = renderer ? &renderer->style() : nullptr; 1385 1385 bool horizontalText = !style || style->isHorizontalWritingMode(); 1386 1386 const Cursor& iBeam = horizontalText ? iBeamCursor() : verticalTextCursor(); -
trunk/Source/WebCore/page/animation/AnimationBase.cpp
r200047 r200098 71 71 } 72 72 73 AnimationBase::AnimationBase( Animation& animation, RenderElement* renderer, CompositeAnimation* compositeAnimation)73 AnimationBase::AnimationBase(const Animation& animation, RenderElement* renderer, CompositeAnimation* compositeAnimation) 74 74 : m_object(renderer) 75 75 , m_compositeAnimation(compositeAnimation) 76 , m_animation( animation)76 , m_animation(const_cast<Animation&>(animation)) 77 77 { 78 78 // Compute the total duration -
trunk/Source/WebCore/page/animation/AnimationBase.h
r200047 r200098 53 53 WTF_MAKE_FAST_ALLOCATED; 54 54 public: 55 AnimationBase( Animation& transition, RenderElement*, CompositeAnimation*);55 AnimationBase(const Animation& transition, RenderElement*, CompositeAnimation*); 56 56 virtual ~AnimationBase() { } 57 57 … … 139 139 140 140 // Returns true if the animation state changed. 141 virtual bool animate(CompositeAnimation*, RenderElement*, const RenderStyle* /*currentStyle*/, RenderStyle* /*targetStyle*/, std::unique_ptr<RenderStyle>& /*animatedStyle*/) = 0;141 virtual bool animate(CompositeAnimation*, RenderElement*, const RenderStyle* /*currentStyle*/, const RenderStyle* /*targetStyle*/, std::unique_ptr<RenderStyle>& /*animatedStyle*/) = 0; 142 142 virtual void getAnimatedStyle(std::unique_ptr<RenderStyle>& /*animatedStyle*/) = 0; 143 143 … … 151 151 152 152 const Animation& animation() const { return m_animation; } 153 void setAnimation( Animation& animation) { m_animation = animation; }153 void setAnimation(const Animation& animation) { m_animation = const_cast<Animation&>(animation); } 154 154 155 155 // Return true if this animation is overridden. This will only be the case for -
trunk/Source/WebCore/page/animation/AnimationController.cpp
r200041 r200098 594 594 } 595 595 596 bool AnimationController::updateAnimations(RenderElement& renderer, RenderStyle& newStyle, std::unique_ptr<RenderStyle>& animatedStyle)597 { 598 RenderStyle* oldStyle = renderer.hasInitializedStyle() ? &renderer.style() : nullptr;596 bool AnimationController::updateAnimations(RenderElement& renderer, const RenderStyle& newStyle, std::unique_ptr<RenderStyle>& animatedStyle) 597 { 598 auto* oldStyle = renderer.hasInitializedStyle() ? &renderer.style() : nullptr; 599 599 if ((!oldStyle || (!oldStyle->animations() && !oldStyle->transitions())) && (!newStyle.animations() && !newStyle.transitions())) 600 600 return false; -
trunk/Source/WebCore/page/animation/AnimationController.h
r199964 r200098 51 51 52 52 void cancelAnimations(RenderElement&); 53 bool updateAnimations(RenderElement&, RenderStyle& newStyle, std::unique_ptr<RenderStyle>& animatedStyle);53 bool updateAnimations(RenderElement&, const RenderStyle& newStyle, std::unique_ptr<RenderStyle>& animatedStyle); 54 54 std::unique_ptr<RenderStyle> getAnimatedStyleForRenderer(RenderElement&); 55 55 -
trunk/Source/WebCore/page/animation/CompositeAnimation.cpp
r200047 r200098 78 78 } 79 79 80 void CompositeAnimation::updateTransitions(RenderElement* renderer, RenderStyle* currentStyle,RenderStyle* targetStyle)80 void CompositeAnimation::updateTransitions(RenderElement* renderer, const RenderStyle* currentStyle, const RenderStyle* targetStyle) 81 81 { 82 82 // If currentStyle is null or there are no old or new transitions, just skip it … … 94 94 if (targetStyle->transitions()) { 95 95 for (size_t i = 0; i < targetStyle->transitions()->size(); ++i) { 96 Animation& animation = targetStyle->transitions()->animation(i);96 auto& animation = targetStyle->transitions()->animation(i); 97 97 bool isActiveTransition = !m_suspended && (animation.duration() || animation.delay() > 0); 98 98 … … 123 123 // against the unanimated style here, but we "override" the transition later. 124 124 RefPtr<KeyframeAnimation> keyframeAnim = getAnimationForProperty(prop); 125 RenderStyle* fromStyle = keyframeAnim ? keyframeAnim->unanimatedStyle() : currentStyle;125 auto* fromStyle = keyframeAnim ? keyframeAnim->unanimatedStyle() : currentStyle; 126 126 127 127 // See if there is a current transition for this prop … … 196 196 } 197 197 198 void CompositeAnimation::updateKeyframeAnimations(RenderElement* renderer, RenderStyle* currentStyle,RenderStyle* targetStyle)198 void CompositeAnimation::updateKeyframeAnimations(RenderElement* renderer, const RenderStyle* currentStyle, const RenderStyle* targetStyle) 199 199 { 200 200 // Nothing to do if we don't have any animations, and didn't have any before … … 222 222 int numAnims = targetStyle->animations()->size(); 223 223 for (int i = 0; i < numAnims; ++i) { 224 Animation& animation = targetStyle->animations()->animation(i);224 auto& animation = targetStyle->animations()->animation(i); 225 225 AtomicString animationName(animation.name()); 226 226 … … 285 285 } 286 286 287 bool CompositeAnimation::animate(RenderElement& renderer, RenderStyle* currentStyle,RenderStyle& targetStyle, std::unique_ptr<RenderStyle>& blendedStyle)287 bool CompositeAnimation::animate(RenderElement& renderer, const RenderStyle* currentStyle, const RenderStyle& targetStyle, std::unique_ptr<RenderStyle>& blendedStyle) 288 288 { 289 289 // We don't do any transitions if we don't have a currentStyle (on startup). -
trunk/Source/WebCore/page/animation/CompositeAnimation.h
r199964 r200098 57 57 void clearRenderer(); 58 58 59 bool animate(RenderElement&, RenderStyle* currentStyle,RenderStyle& targetStyle, std::unique_ptr<RenderStyle>& blendedStyle);59 bool animate(RenderElement&, const RenderStyle* currentStyle, const RenderStyle& targetStyle, std::unique_ptr<RenderStyle>& blendedStyle); 60 60 std::unique_ptr<RenderStyle> getAnimatedStyle() const; 61 61 bool computeExtentOfTransformAnimation(LayoutRect&) const; … … 89 89 CompositeAnimation(AnimationControllerPrivate&); 90 90 91 void updateTransitions(RenderElement*, RenderStyle* currentStyle,RenderStyle* targetStyle);92 void updateKeyframeAnimations(RenderElement*, RenderStyle* currentStyle,RenderStyle* targetStyle);91 void updateTransitions(RenderElement*, const RenderStyle* currentStyle, const RenderStyle* targetStyle); 92 void updateKeyframeAnimations(RenderElement*, const RenderStyle* currentStyle, const RenderStyle* targetStyle); 93 93 94 94 typedef HashMap<int, RefPtr<ImplicitAnimation>> CSSPropertyTransitionsMap; -
trunk/Source/WebCore/page/animation/ImplicitAnimation.cpp
r200041 r200098 40 40 namespace WebCore { 41 41 42 ImplicitAnimation::ImplicitAnimation( Animation& transition, CSSPropertyID animatingProperty, RenderElement* renderer, CompositeAnimation* compAnim,RenderStyle* fromStyle)42 ImplicitAnimation::ImplicitAnimation(const Animation& transition, CSSPropertyID animatingProperty, RenderElement* renderer, CompositeAnimation* compAnim, const RenderStyle* fromStyle) 43 43 : AnimationBase(transition, renderer, compAnim) 44 44 , m_fromStyle(RenderStyle::clonePtr(*fromStyle)) … … 61 61 } 62 62 63 bool ImplicitAnimation::animate(CompositeAnimation*, RenderElement*, const RenderStyle*, RenderStyle* targetStyle, std::unique_ptr<RenderStyle>& animatedStyle)63 bool ImplicitAnimation::animate(CompositeAnimation*, RenderElement*, const RenderStyle*, const RenderStyle* targetStyle, std::unique_ptr<RenderStyle>& animatedStyle) 64 64 { 65 65 // If we get this far and the animation is done, it means we are cleaning up a just finished animation. … … 206 206 } 207 207 208 void ImplicitAnimation::reset( RenderStyle* to)208 void ImplicitAnimation::reset(const RenderStyle* to) 209 209 { 210 210 ASSERT(to); -
trunk/Source/WebCore/page/animation/ImplicitAnimation.h
r199964 r200098 42 42 class ImplicitAnimation : public AnimationBase { 43 43 public: 44 static Ref<ImplicitAnimation> create( Animation& animation, CSSPropertyID animatingProperty, RenderElement* renderer, CompositeAnimation* compositeAnimation,RenderStyle* fromStyle)44 static Ref<ImplicitAnimation> create(const Animation& animation, CSSPropertyID animatingProperty, RenderElement* renderer, CompositeAnimation* compositeAnimation, const RenderStyle* fromStyle) 45 45 { 46 46 return adoptRef(*new ImplicitAnimation(animation, animatingProperty, renderer, compositeAnimation, fromStyle)); … … 55 55 void endAnimation() override; 56 56 57 bool animate(CompositeAnimation*, RenderElement*, const RenderStyle* currentStyle, RenderStyle* targetStyle, std::unique_ptr<RenderStyle>& animatedStyle) override;57 bool animate(CompositeAnimation*, RenderElement*, const RenderStyle* currentStyle, const RenderStyle* targetStyle, std::unique_ptr<RenderStyle>& animatedStyle) override; 58 58 void getAnimatedStyle(std::unique_ptr<RenderStyle>& animatedStyle) override; 59 v irtual void reset(RenderStyle* to);59 void reset(const RenderStyle* to); 60 60 61 61 bool computeExtentOfTransformAnimation(LayoutRect&) const override; … … 88 88 89 89 private: 90 ImplicitAnimation( Animation&, CSSPropertyID, RenderElement*, CompositeAnimation*,RenderStyle*);90 ImplicitAnimation(const Animation&, CSSPropertyID, RenderElement*, CompositeAnimation*, const RenderStyle*); 91 91 virtual ~ImplicitAnimation(); 92 92 -
trunk/Source/WebCore/page/animation/KeyframeAnimation.cpp
r200047 r200098 42 42 namespace WebCore { 43 43 44 KeyframeAnimation::KeyframeAnimation( Animation& animation, RenderElement* renderer, CompositeAnimation* compositeAnimation,RenderStyle* unanimatedStyle)44 KeyframeAnimation::KeyframeAnimation(const Animation& animation, RenderElement* renderer, CompositeAnimation* compositeAnimation, const RenderStyle* unanimatedStyle) 45 45 : AnimationBase(animation, renderer, compositeAnimation) 46 46 , m_keyframes(animation.name()) … … 125 125 } 126 126 127 bool KeyframeAnimation::animate(CompositeAnimation* compositeAnimation, RenderElement*, const RenderStyle*, RenderStyle* targetStyle, std::unique_ptr<RenderStyle>& animatedStyle)127 bool KeyframeAnimation::animate(CompositeAnimation* compositeAnimation, RenderElement*, const RenderStyle*, const RenderStyle* targetStyle, std::unique_ptr<RenderStyle>& animatedStyle) 128 128 { 129 129 // Fire the start timeout if needed -
trunk/Source/WebCore/page/animation/KeyframeAnimation.h
r200047 r200098 41 41 class KeyframeAnimation final : public AnimationBase { 42 42 public: 43 static Ref<KeyframeAnimation> create( Animation& animation, RenderElement* renderer, CompositeAnimation* compositeAnimation,RenderStyle* unanimatedStyle)43 static Ref<KeyframeAnimation> create(const Animation& animation, RenderElement* renderer, CompositeAnimation* compositeAnimation, const RenderStyle* unanimatedStyle) 44 44 { 45 45 return adoptRef(*new KeyframeAnimation(animation, renderer, compositeAnimation, unanimatedStyle)); 46 46 } 47 47 48 bool animate(CompositeAnimation*, RenderElement*, const RenderStyle* currentStyle, RenderStyle* targetStyle, std::unique_ptr<RenderStyle>& animatedStyle) override;48 bool animate(CompositeAnimation*, RenderElement*, const RenderStyle* currentStyle, const RenderStyle* targetStyle, std::unique_ptr<RenderStyle>& animatedStyle) override; 49 49 void getAnimatedStyle(std::unique_ptr<RenderStyle>&) override; 50 50 … … 89 89 90 90 private: 91 KeyframeAnimation( Animation&, RenderElement*, CompositeAnimation*,RenderStyle* unanimatedStyle);91 KeyframeAnimation(const Animation&, RenderElement*, CompositeAnimation*, const RenderStyle* unanimatedStyle); 92 92 virtual ~KeyframeAnimation(); 93 93 -
trunk/Source/WebCore/page/ios/FrameIOS.mm
r193884 r200098 288 288 } 289 289 290 RenderStyle& style = renderer->style();290 auto& style = renderer->style(); 291 291 292 292 if (renderer->hasOverflowClip() && -
trunk/Source/WebCore/rendering/FlowThreadController.cpp
r187659 r200098 82 82 void FlowThreadController::styleDidChange() 83 83 { 84 RenderStyle& viewStyle = m_view->style();84 auto& viewStyle = m_view->style(); 85 85 for (auto& flowRenderer : *m_renderNamedFlowThreadList) 86 86 flowRenderer->setStyle(RenderFlowThread::createFlowThreadStyle(&viewStyle)); -
trunk/Source/WebCore/rendering/InlineFlowBox.cpp
r196222 r200098 1329 1329 { 1330 1330 LayoutRect clipRect(paintRect); 1331 RenderStyle& style = box->renderer().style();1331 auto& style = box->renderer().style(); 1332 1332 LayoutBoxExtent outsets = style.imageOutsets(image); 1333 1333 if (box->isHorizontal()) { -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r200041 r200098 288 288 void RenderBlock::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle) 289 289 { 290 RenderStyle& newStyle = style();290 auto& newStyle = style(); 291 291 292 292 bool hadTransform = hasTransform(); … … 2838 2838 2839 2839 if (firstLine && view().usesFirstLineRules()) { 2840 RenderStyle& s = firstLine ? firstLineStyle() : style();2840 auto& s = firstLine ? firstLineStyle() : style(); 2841 2841 if (&s != &style()) 2842 2842 return s.computedLineHeight(); … … 2977 2977 } 2978 2978 2979 static RenderStyle& styleForFirstLetter(RenderElement* firstLetterBlock, RenderObject* firstLetterContainer)2980 { 2981 RenderStyle* pseudoStyle = firstLetterBlock->getCachedPseudoStyle(FIRST_LETTER, &firstLetterContainer->firstLineStyle());2979 static const RenderStyle& styleForFirstLetter(RenderElement* firstLetterBlock, RenderObject* firstLetterContainer) 2980 { 2981 auto* pseudoStyle = firstLetterBlock->getMutableCachedPseudoStyle(FIRST_LETTER, &firstLetterContainer->firstLineStyle()); 2982 2982 2983 2983 // If we have an initial letter drop that is >= 1, then we need to force floating to be on. … … 3062 3062 RenderElement* firstLetter = currentChild->parent(); 3063 3063 RenderElement* firstLetterContainer = firstLetter->parent(); 3064 RenderStyle& pseudoStyle = styleForFirstLetter(firstLetterBlock, firstLetterContainer);3064 auto& pseudoStyle = styleForFirstLetter(firstLetterBlock, firstLetterContainer); 3065 3065 ASSERT(firstLetter->isFloating() || firstLetter->isInline()); 3066 3066 … … 3103 3103 { 3104 3104 RenderElement* firstLetterContainer = currentTextChild->parent(); 3105 RenderStyle& pseudoStyle = styleForFirstLetter(firstLetterBlock, firstLetterContainer);3105 auto& pseudoStyle = styleForFirstLetter(firstLetterBlock, firstLetterContainer); 3106 3106 RenderBoxModelObject* firstLetter = nullptr; 3107 3107 if (pseudoStyle.display() == INLINE) -
trunk/Source/WebCore/rendering/RenderBlockFlow.cpp
r200041 r200098 1616 1616 } 1617 1617 1618 static inline LayoutUnit calculateMinimumPageHeight( RenderStyle& renderStyle, RootInlineBox& lastLine, LayoutUnit lineTop, LayoutUnit lineBottom)1618 static inline LayoutUnit calculateMinimumPageHeight(const RenderStyle& renderStyle, RootInlineBox& lastLine, LayoutUnit lineTop, LayoutUnit lineBottom) 1619 1619 { 1620 1620 // We may require a certain minimum number of lines per page in order to satisfy … … 3724 3724 if (isVisibleRenderText(descendent) && resizeTextPermitted(descendent)) { 3725 3725 RenderText& text = downcast<RenderText>(*descendent); 3726 RenderStyle& oldStyle = text.style();3726 auto& oldStyle = text.style(); 3727 3727 auto fontDescription = oldStyle.fontDescription(); 3728 3728 float specifiedSize = fontDescription.specifiedSize(); -
trunk/Source/WebCore/rendering/RenderBox.cpp
r200041 r200098 385 385 // Propagate the new writing mode and direction up to the RenderView. 386 386 auto* documentElementRenderer = document().documentElement()->renderer(); 387 RenderStyle& viewStyle = view().style();387 auto& viewStyle = view().mutableStyle(); 388 388 bool viewChangedWritingMode = false; 389 389 bool rootStyleChanged = false; … … 394 394 viewStyleChanged = true; 395 395 if (isBodyRenderer) { 396 rootRenderer-> style().setDirection(newStyle.direction());396 rootRenderer->mutableStyle().setDirection(newStyle.direction()); 397 397 rootStyleChanged = true; 398 398 } … … 408 408 if (isBodyRenderer) { 409 409 rootStyleChanged = true; 410 rootRenderer-> style().setWritingMode(newStyle.writingMode());410 rootRenderer->mutableStyle().setWritingMode(newStyle.writingMode()); 411 411 rootRenderer->setHorizontalWritingMode(newStyle.isHorizontalWritingMode()); 412 412 } … … 433 433 // the basis of the grid. 434 434 if (newStyle.fontDescription() != view().style().fontDescription()) { 435 view(). style().setFontDescription(newStyle.fontDescription());436 view(). style().fontCascade().update(&document().fontSelector());435 view().mutableStyle().setFontDescription(newStyle.fontDescription()); 436 view().mutableStyle().fontCascade().update(&document().fontSelector()); 437 437 } 438 438 } … … 681 681 RoundedRect::Radii RenderBox::borderRadii() const 682 682 { 683 RenderStyle& style = this->style();683 auto& style = this->style(); 684 684 LayoutRect bounds = frameRect(); 685 685 … … 4815 4815 } 4816 4816 4817 LayoutRect RenderBox::logicalVisualOverflowRectForPropagation( RenderStyle* parentStyle) const4817 LayoutRect RenderBox::logicalVisualOverflowRectForPropagation(const RenderStyle* parentStyle) const 4818 4818 { 4819 4819 LayoutRect rect = visualOverflowRectForPropagation(parentStyle); … … 4823 4823 } 4824 4824 4825 LayoutRect RenderBox::visualOverflowRectForPropagation( RenderStyle* parentStyle) const4825 LayoutRect RenderBox::visualOverflowRectForPropagation(const RenderStyle* parentStyle) const 4826 4826 { 4827 4827 // If the writing modes of the child and parent match, then we don't have to … … 4841 4841 } 4842 4842 4843 LayoutRect RenderBox::logicalLayoutOverflowRectForPropagation( RenderStyle* parentStyle) const4843 LayoutRect RenderBox::logicalLayoutOverflowRectForPropagation(const RenderStyle* parentStyle) const 4844 4844 { 4845 4845 LayoutRect rect = layoutOverflowRectForPropagation(parentStyle); … … 4849 4849 } 4850 4850 4851 LayoutRect RenderBox::layoutOverflowRectForPropagation( RenderStyle* parentStyle) const4851 LayoutRect RenderBox::layoutOverflowRectForPropagation(const RenderStyle* parentStyle) const 4852 4852 { 4853 4853 // Only propagate interior layout overflow if we don't clip it. -
trunk/Source/WebCore/rendering/RenderBox.h
r200041 r200098 564 564 } 565 565 566 LayoutRect logicalVisualOverflowRectForPropagation( RenderStyle*) const;567 LayoutRect visualOverflowRectForPropagation( RenderStyle*) const;568 LayoutRect logicalLayoutOverflowRectForPropagation( RenderStyle*) const;569 LayoutRect layoutOverflowRectForPropagation( RenderStyle*) const;566 LayoutRect logicalVisualOverflowRectForPropagation(const RenderStyle*) const; 567 LayoutRect visualOverflowRectForPropagation(const RenderStyle*) const; 568 LayoutRect logicalLayoutOverflowRectForPropagation(const RenderStyle*) const; 569 LayoutRect layoutOverflowRectForPropagation(const RenderStyle*) const; 570 570 571 571 bool hasRenderOverflow() const { return m_overflow; } -
trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp
r200041 r200098 582 582 } 583 583 584 static void applyBoxShadowForBackground(GraphicsContext& context, RenderStyle* style)584 static void applyBoxShadowForBackground(GraphicsContext& context, const RenderStyle* style) 585 585 { 586 586 const ShadowData* boxShadow = style->boxShadow(); -
trunk/Source/WebCore/rendering/RenderButton.cpp
r200041 r200098 70 70 ASSERT(!firstChild()); 71 71 m_inner = createAnonymousBlock(style().display()); 72 setupInnerStyle(&m_inner-> style());72 setupInnerStyle(&m_inner->mutableStyle()); 73 73 RenderFlexibleBox::addChild(m_inner); 74 74 } … … 98 98 // because of the difference. Same goes for the other properties. 99 99 // FIXME: Make this hack unnecessary. 100 m_inner-> style().setFlexGrow(newStyle.initialFlexGrow());101 m_inner-> style().setMarginTop(newStyle.initialMargin());102 m_inner-> style().setMarginBottom(newStyle.initialMargin());100 m_inner->mutableStyle().setFlexGrow(newStyle.initialFlexGrow()); 101 m_inner->mutableStyle().setMarginTop(newStyle.initialMargin()); 102 m_inner->mutableStyle().setMarginBottom(newStyle.initialMargin()); 103 103 } 104 104 RenderBlock::styleWillChange(diff, newStyle); … … 110 110 111 111 if (m_inner) // RenderBlock handled updating the anonymous block's style. 112 setupInnerStyle(&m_inner-> style());112 setupInnerStyle(&m_inner->mutableStyle()); 113 113 } 114 114 … … 175 175 176 176 // FIXME: We should not be adjusting styles during layout. See <rdar://problem/7675493>. 177 RenderThemeIOS::adjustRoundBorderRadius( style(), *this);177 RenderThemeIOS::adjustRoundBorderRadius(mutableStyle(), *this); 178 178 } 179 179 #endif -
trunk/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp
r200041 r200098 166 166 void RenderDeprecatedFlexibleBox::styleWillChange(StyleDifference diff, const RenderStyle& newStyle) 167 167 { 168 RenderStyle* oldStyle = hasInitializedStyle() ? &style() : nullptr;168 auto* oldStyle = hasInitializedStyle() ? &style() : nullptr; 169 169 if (oldStyle && !oldStyle->lineClamp().isNone() && newStyle.lineClamp().isNone()) 170 170 clearLineClamp(); -
trunk/Source/WebCore/rendering/RenderElement.cpp
r200041 r200098 206 206 } 207 207 208 enum StyleCacheState {209 Cached,210 Uncached211 };212 213 208 std::unique_ptr<RenderStyle> RenderElement::uncachedFirstLineStyle(RenderStyle* style) const 214 209 { … … 222 217 return firstLineBlock->getUncachedPseudoStyle(PseudoStyleRequest(FIRST_LINE), style, firstLineBlock == this ? style : nullptr); 223 218 } else if (!rendererForFirstLineStyle.isAnonymous() && rendererForFirstLineStyle.isRenderInline()) { 224 RenderStyle& parentStyle = rendererForFirstLineStyle.parent()->firstLineStyle();219 auto& parentStyle = rendererForFirstLineStyle.parent()->firstLineStyle(); 225 220 if (&parentStyle != &rendererForFirstLineStyle.parent()->style()) 226 221 return rendererForFirstLineStyle.getUncachedPseudoStyle(PseudoStyleRequest(FIRST_LINE_INHERITED), &parentStyle, style); … … 229 224 } 230 225 231 RenderStyle* RenderElement::cachedFirstLineStyle() const226 const RenderStyle* RenderElement::cachedFirstLineStyle() const 232 227 { 233 228 ASSERT(view().usesFirstLineRules()); … … 239 234 return firstLineBlock->getCachedPseudoStyle(FIRST_LINE, &style()); 240 235 } else if (!rendererForFirstLineStyle.isAnonymous() && rendererForFirstLineStyle.isRenderInline()) { 241 RenderStyle& parentStyle = rendererForFirstLineStyle.parent()->firstLineStyle();236 auto& parentStyle = rendererForFirstLineStyle.parent()->firstLineStyle(); 242 237 if (&parentStyle != &rendererForFirstLineStyle.parent()->style()) { 243 238 // A first-line style is in effect. Cache a first-line style for ourselves. 244 rendererForFirstLineStyle. style().setHasPseudoStyle(FIRST_LINE_INHERITED);239 rendererForFirstLineStyle.m_style.setHasPseudoStyle(FIRST_LINE_INHERITED); 245 240 return rendererForFirstLineStyle.getCachedPseudoStyle(FIRST_LINE_INHERITED, &parentStyle); 246 241 } … … 250 245 } 251 246 252 RenderStyle& RenderElement::firstLineStyle() const247 const RenderStyle& RenderElement::firstLineStyle() const 253 248 { 254 249 return view().usesFirstLineRules() ? *cachedFirstLineStyle() : style(); … … 807 802 void RenderElement::styleWillChange(StyleDifference diff, const RenderStyle& newStyle) 808 803 { 809 RenderStyle* oldStyle = hasInitializedStyle() ? &style() : nullptr;804 auto* oldStyle = hasInitializedStyle() ? &style() : nullptr; 810 805 if (oldStyle) { 811 806 // If our z-index changes value or our visibility changes, … … 1536 1531 } 1537 1532 1538 RenderStyle* RenderElement::getCachedPseudoStyle(PseudoId pseudo,RenderStyle* parentStyle) const1533 const RenderStyle* RenderElement::getCachedPseudoStyle(PseudoId pseudo, const RenderStyle* parentStyle) const 1539 1534 { 1540 1535 if (pseudo < FIRST_INTERNAL_PSEUDOID && !style().hasPseudoStyle(pseudo)) … … 1547 1542 std::unique_ptr<RenderStyle> result = getUncachedPseudoStyle(PseudoStyleRequest(pseudo), parentStyle); 1548 1543 if (result) 1549 return style().addCachedPseudoStyle(WTFMove(result));1544 return const_cast<RenderStyle&>(m_style).addCachedPseudoStyle(WTFMove(result)); 1550 1545 return nullptr; 1551 1546 } 1552 1547 1553 std::unique_ptr<RenderStyle> RenderElement::getUncachedPseudoStyle(const PseudoStyleRequest& pseudoStyleRequest, RenderStyle* parentStyle, RenderStyle* ownStyle) const 1548 RenderStyle* RenderElement::getMutableCachedPseudoStyle(PseudoId pseudo, const RenderStyle* parentStyle) 1549 { 1550 if (pseudo < FIRST_INTERNAL_PSEUDOID && !style().hasPseudoStyle(pseudo)) 1551 return nullptr; 1552 1553 RenderStyle* cachedStyle = style().getCachedPseudoStyle(pseudo); 1554 if (cachedStyle) 1555 return cachedStyle; 1556 1557 std::unique_ptr<RenderStyle> result = getUncachedPseudoStyle(PseudoStyleRequest(pseudo), parentStyle); 1558 if (result) 1559 return m_style.addCachedPseudoStyle(WTFMove(result)); 1560 return nullptr; 1561 } 1562 1563 std::unique_ptr<RenderStyle> RenderElement::getUncachedPseudoStyle(const PseudoStyleRequest& pseudoStyleRequest, const RenderStyle* parentStyle, const RenderStyle* ownStyle) const 1554 1564 { 1555 1565 if (pseudoStyleRequest.pseudoId < FIRST_INTERNAL_PSEUDOID && !ownStyle && !style().hasPseudoStyle(pseudoStyleRequest.pseudoId)) … … 2067 2077 return; 2068 2078 2069 RenderStyle& styleToUse = style();2079 auto& styleToUse = style(); 2070 2080 float outlineWidth = floorToDevicePixel(styleToUse.outlineWidth(), document().deviceScaleFactor()); 2071 2081 float outlineOffset = floorToDevicePixel(styleToUse.outlineOffset(), document().deviceScaleFactor()); -
trunk/Source/WebCore/rendering/RenderElement.h
r200041 r200098 41 41 bool hasInitializedStyle() const { return m_hasInitializedStyle; } 42 42 43 RenderStyle& style() const { return const_cast<RenderStyle&>(m_style); } 44 RenderStyle& firstLineStyle() const; 43 const RenderStyle& style() const { return m_style; } 44 const RenderStyle& firstLineStyle() const; 45 46 // FIXME: Style shouldn't be mutated. 47 RenderStyle& mutableStyle() { return m_style; } 45 48 46 49 void initializeStyle(); … … 53 56 // The pseudo element style can be cached or uncached. Use the cached method if the pseudo element doesn't respect 54 57 // any pseudo classes (and therefore has no concept of changing state). 55 RenderStyle* getCachedPseudoStyle(PseudoId, RenderStyle* parentStyle = nullptr) const; 56 std::unique_ptr<RenderStyle> getUncachedPseudoStyle(const PseudoStyleRequest&, RenderStyle* parentStyle = nullptr, RenderStyle* ownStyle = nullptr) const; 58 const RenderStyle* getCachedPseudoStyle(PseudoId, const RenderStyle* parentStyle = nullptr) const; 59 RenderStyle* getMutableCachedPseudoStyle(PseudoId, const RenderStyle* parentStyle = nullptr); 60 std::unique_ptr<RenderStyle> getUncachedPseudoStyle(const PseudoStyleRequest&, const RenderStyle* parentStyle = nullptr, const RenderStyle* ownStyle = nullptr) const; 57 61 58 62 // This is null for anonymous renderers. … … 299 303 300 304 StyleDifference adjustStyleDifference(StyleDifference, unsigned contextSensitiveProperties) const; 301 RenderStyle* cachedFirstLineStyle() const;305 const RenderStyle* cachedFirstLineStyle() const; 302 306 303 307 void newImageAnimationFrameAvailable(CachedImage&) final; … … 451 455 } 452 456 453 inline RenderStyle& RenderObject::style() const457 inline const RenderStyle& RenderObject::style() const 454 458 { 455 459 if (isText()) … … 458 462 } 459 463 460 inline RenderStyle& RenderObject::firstLineStyle() const464 inline const RenderStyle& RenderObject::firstLineStyle() const 461 465 { 462 466 if (isText()) -
trunk/Source/WebCore/rendering/RenderEmbeddedObject.cpp
r200041 r200098 523 523 524 524 childBox.setLocation(LayoutPoint(borderLeft(), borderTop()) + LayoutSize(paddingLeft(), paddingTop())); 525 childBox. style().setHeight(Length(newSize.height(), Fixed));526 childBox. style().setWidth(Length(newSize.width(), Fixed));525 childBox.mutableStyle().setHeight(Length(newSize.height(), Fixed)); 526 childBox.mutableStyle().setWidth(Length(newSize.width(), Fixed)); 527 527 childBox.setNeedsLayout(MarkOnlyThis); 528 528 childBox.layout(); -
trunk/Source/WebCore/rendering/RenderFlowThread.cpp
r200041 r200098 70 70 } 71 71 72 RenderStyle RenderFlowThread::createFlowThreadStyle( RenderStyle* parentStyle)72 RenderStyle RenderFlowThread::createFlowThreadStyle(const RenderStyle* parentStyle) 73 73 { 74 74 auto newStyle = RenderStyle::create(); -
trunk/Source/WebCore/rendering/RenderFlowThread.h
r200041 r200098 100 100 virtual void flowThreadDescendantBoxLaidOut(RenderBox*) { } 101 101 102 static RenderStyle createFlowThreadStyle( RenderStyle* parentStyle);102 static RenderStyle createFlowThreadStyle(const RenderStyle* parentStyle); 103 103 104 104 void styleDidChange(StyleDifference, const RenderStyle* oldStyle) override; -
trunk/Source/WebCore/rendering/RenderImage.cpp
r200041 r200098 717 717 if (shadowControlsNeedCustomLayoutMetrics()) { 718 718 controlsRenderer->setLocation(LayoutPoint(borderLeft(), borderTop()) + LayoutSize(paddingLeft(), paddingTop())); 719 controlsRenderer-> style().setHeight(Length(newSize.height(), Fixed));720 controlsRenderer-> style().setWidth(Length(newSize.width(), Fixed));719 controlsRenderer->mutableStyle().setHeight(Length(newSize.height(), Fixed)); 720 controlsRenderer->mutableStyle().setWidth(Length(newSize.width(), Fixed)); 721 721 } 722 722 -
trunk/Source/WebCore/rendering/RenderInline.cpp
r200041 r200098 188 188 // and after the block share the same style, but the block doesn't 189 189 // need to pass its style on to anyone else. 190 RenderStyle& newStyle = style();190 auto& newStyle = style(); 191 191 RenderInline* continuation = inlineElementContinuation(); 192 192 if (continuation) { … … 221 221 return; 222 222 223 RenderStyle* parentStyle = &parent()->style();223 auto* parentStyle = &parent()->style(); 224 224 RenderInline* parentRenderInline = is<RenderInline>(*parent()) ? downcast<RenderInline>(parent()) : nullptr; 225 225 bool checkFonts = document().inNoQuirksMode(); … … 236 236 // Have to check the first line style as well. 237 237 parentStyle = &parent()->firstLineStyle(); 238 RenderStyle& childStyle = firstLineStyle();238 auto& childStyle = firstLineStyle(); 239 239 alwaysCreateLineBoxes = !parentStyle->fontCascade().fontMetrics().hasIdenticalAscentDescentAndLineGap(childStyle.fontCascade().fontMetrics()) 240 240 || childStyle.verticalAlign() != BASELINE … … 1602 1602 return; 1603 1603 1604 RenderStyle& styleToUse = style();1604 auto& styleToUse = style(); 1605 1605 // Only paint the focus ring by hand if the theme isn't able to draw it. 1606 1606 if (styleToUse.outlineStyleIsAuto() && !theme().supportsFocusRing(styleToUse)) { -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r200041 r200098 4112 4112 } 4113 4113 4114 RenderStyle& style = renderer().style();4114 auto& style = renderer().style(); 4115 4115 ASSERT(style.clipPath()); 4116 4116 if (is<ShapeClipPathOperation>(*style.clipPath()) || (is<BoxClipPathOperation>(*style.clipPath()) && is<RenderBox>(renderer()))) { -
trunk/Source/WebCore/rendering/RenderListBox.cpp
r200041 r200098 355 355 } 356 356 357 static LayoutSize itemOffsetForAlignment(TextRun textRun, RenderStyle* itemStyle, FontCascade itemFont, LayoutRect itemBoudingBox)357 static LayoutSize itemOffsetForAlignment(TextRun textRun, const RenderStyle* itemStyle, FontCascade itemFont, LayoutRect itemBoudingBox) 358 358 { 359 359 ETextAlign actualAlignment = itemStyle->textAlign(); … … 380 380 HTMLElement* listItemElement = listItems[listIndex]; 381 381 382 RenderStyle& itemStyle = *listItemElement->computedStyle();382 auto& itemStyle = *listItemElement->computedStyle(); 383 383 384 384 if (itemStyle.visibility() == HIDDEN) … … 424 424 const Vector<HTMLElement*>& listItems = selectElement().listItems(); 425 425 HTMLElement* listItemElement = listItems[listIndex]; 426 RenderStyle& itemStyle = *listItemElement->computedStyle();426 auto& itemStyle = *listItemElement->computedStyle(); 427 427 428 428 Color backColor; -
trunk/Source/WebCore/rendering/RenderListMarker.cpp
r200041 r200098 1709 1709 } 1710 1710 1711 style().setMarginStart(Length(marginStart, Fixed));1712 style().setMarginEnd(Length(marginEnd, Fixed));1711 mutableStyle().setMarginStart(Length(marginStart, Fixed)); 1712 mutableStyle().setMarginEnd(Length(marginEnd, Fixed)); 1713 1713 } 1714 1714 -
trunk/Source/WebCore/rendering/RenderMarquee.cpp
r194466 r200098 111 111 RenderBox* box = m_layer->renderBox(); 112 112 ASSERT(box); 113 RenderStyle& boxStyle = box->style();113 auto& boxStyle = box->style(); 114 114 if (isHorizontal()) { 115 115 bool ltr = boxStyle.isLeftToRightDirection(); … … 198 198 void RenderMarquee::updateMarqueeStyle() 199 199 { 200 RenderStyle& style = m_layer->renderer().style();200 auto& style = m_layer->renderer().mutableStyle(); 201 201 202 202 if (m_direction != style.marqueeDirection() || (m_totalLoops != style.marqueeLoopCount() && m_currentLoop >= m_totalLoops)) -
trunk/Source/WebCore/rendering/RenderMenuList.cpp
r200041 r200098 110 110 void RenderMenuList::adjustInnerStyle() 111 111 { 112 RenderStyle& innerStyle = m_innerBlock->style();112 auto& innerStyle = m_innerBlock->mutableStyle(); 113 113 innerStyle.setFlexGrow(1); 114 114 innerStyle.setFlexShrink(1); … … 216 216 // Add in the option's text indent. We can't calculate percentage values for now. 217 217 float optionWidth = 0; 218 if ( RenderStyle* optionStyle = element->computedStyle())218 if (auto* optionStyle = element->computedStyle()) 219 219 optionWidth += minimumValueForLength(optionStyle->textIndent(), 0); 220 220 if (!text.isEmpty()) { … … 520 520 getItemBackgroundColor(listIndex, itemBackgroundColor, itemHasCustomBackgroundColor); 521 521 522 RenderStyle& style = *element->computedStyle();522 auto& style = *element->computedStyle(); 523 523 return PopupMenuStyle(style.visitedDependentColor(CSSPropertyColor), itemBackgroundColor, style.fontCascade(), style.visibility() == VISIBLE, 524 524 style.display() == NONE, true, style.textIndent(), style.direction(), isOverride(style.unicodeBidi()), -
trunk/Source/WebCore/rendering/RenderMultiColumnFlowThread.cpp
r200041 r200098 240 240 241 241 // First make sure that the renderer itself has the right properties for becoming a spanner. 242 RenderStyle& style = descendant->style();242 auto& style = descendant->style(); 243 243 if (style.columnSpan() != ColumnSpanAll || !is<RenderBox>(*descendant) || descendant->isFloatingOrOutOfFlowPositioned()) 244 244 return false; -
trunk/Source/WebCore/rendering/RenderMultiColumnSpannerPlaceholder.cpp
r200041 r200098 35 35 namespace WebCore { 36 36 37 RenderMultiColumnSpannerPlaceholder* RenderMultiColumnSpannerPlaceholder::createAnonymous(RenderMultiColumnFlowThread* flowThread, RenderBox* spanner, RenderStyle* parentStyle)37 RenderMultiColumnSpannerPlaceholder* RenderMultiColumnSpannerPlaceholder::createAnonymous(RenderMultiColumnFlowThread* flowThread, RenderBox* spanner, const RenderStyle* parentStyle) 38 38 { 39 39 auto newStyle = RenderStyle::createAnonymousStyleWithDisplay(*parentStyle, BLOCK); -
trunk/Source/WebCore/rendering/RenderMultiColumnSpannerPlaceholder.h
r200041 r200098 39 39 class RenderMultiColumnSpannerPlaceholder final : public RenderBox { 40 40 public: 41 static RenderMultiColumnSpannerPlaceholder* createAnonymous(RenderMultiColumnFlowThread*, RenderBox* spanner, RenderStyle* parentStyle);41 static RenderMultiColumnSpannerPlaceholder* createAnonymous(RenderMultiColumnFlowThread*, RenderBox* spanner, const RenderStyle* parentStyle); 42 42 43 43 RenderBox* spanner() const { return m_spanner; } -
trunk/Source/WebCore/rendering/RenderNamedFlowFragment.cpp
r200041 r200098 348 348 } 349 349 350 std::unique_ptr<RenderStyle> RenderNamedFlowFragment::computeStyleInRegion(RenderElement& renderer, RenderStyle& parentStyle) const350 std::unique_ptr<RenderStyle> RenderNamedFlowFragment::computeStyleInRegion(RenderElement& renderer, const RenderStyle& parentStyle) const 351 351 { 352 352 ASSERT(!renderer.isAnonymous()); -
trunk/Source/WebCore/rendering/RenderNamedFlowFragment.h
r200041 r200098 124 124 const char* renderName() const override { return "RenderNamedFlowFragment"; } 125 125 126 std::unique_ptr<RenderStyle> computeStyleInRegion(RenderElement&, RenderStyle& parentStyle) const;126 std::unique_ptr<RenderStyle> computeStyleInRegion(RenderElement&, const RenderStyle& parentStyle) const; 127 127 void computeChildrenStyleInRegion(RenderElement&); 128 128 void setObjectStyleInRegion(RenderObject*, std::unique_ptr<RenderStyle>, bool objectRegionStyleCached); -
trunk/Source/WebCore/rendering/RenderObject.cpp
r199068 r200098 1823 1823 } 1824 1824 1825 static Color decorationColor( RenderStyle* style)1825 static Color decorationColor(const RenderStyle* style) 1826 1826 { 1827 1827 Color result; … … 1845 1845 { 1846 1846 const RenderObject* current = this; 1847 RenderStyle* styleToUse = nullptr;1847 const RenderStyle* styleToUse = nullptr; 1848 1848 TextDecoration currDecs = TextDecorationNone; 1849 1849 Color resultColor; -
trunk/Source/WebCore/rendering/RenderObject.h
r199068 r200098 698 698 virtual LayoutUnit maxPreferredLogicalWidth() const { return 0; } 699 699 700 RenderStyle& style() const;701 RenderStyle& firstLineStyle() const;700 const RenderStyle& style() const; 701 const RenderStyle& firstLineStyle() const; 702 702 703 703 // Anonymous blocks that are part of of a continuation chain will return their inline continuation's outline style instead. -
trunk/Source/WebCore/rendering/RenderTable.cpp
r200041 r200098 812 812 m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, m_captions[i]->minPreferredLogicalWidth()); 813 813 814 RenderStyle& styleToUse = style();814 auto& styleToUse = style(); 815 815 // FIXME: This should probably be checking for isSpecified since you should be able to use percentage or calc values for min-width. 816 816 if (styleToUse.logicalMinWidth().isFixed() && styleToUse.logicalMinWidth().value() > 0) { -
trunk/Source/WebCore/rendering/RenderTableSection.cpp
r200041 r200098 1199 1199 } 1200 1200 1201 static BoxSide physicalBorderForDirection( RenderStyle* styleForCellFlow, CollapsedBorderSide side)1201 static BoxSide physicalBorderForDirection(const RenderStyle* styleForCellFlow, CollapsedBorderSide side) 1202 1202 { 1203 1203 -
trunk/Source/WebCore/rendering/RenderText.h
r199818 r200098 49 49 virtual bool isTextFragment() const; 50 50 51 RenderStyle& style() const;52 RenderStyle& firstLineStyle() const;53 RenderStyle* getCachedPseudoStyle(PseudoId,RenderStyle* parentStyle = nullptr) const;51 const RenderStyle& style() const; 52 const RenderStyle& firstLineStyle() const; 53 const RenderStyle* getCachedPseudoStyle(PseudoId, const RenderStyle* parentStyle = nullptr) const; 54 54 55 55 Color selectionBackgroundColor() const; … … 252 252 } 253 253 254 inline RenderStyle& RenderText::style() const254 inline const RenderStyle& RenderText::style() const 255 255 { 256 256 return parent()->style(); 257 257 } 258 258 259 inline RenderStyle& RenderText::firstLineStyle() const259 inline const RenderStyle& RenderText::firstLineStyle() const 260 260 { 261 261 return parent()->firstLineStyle(); 262 262 } 263 263 264 inline RenderStyle* RenderText::getCachedPseudoStyle(PseudoId pseudoId,RenderStyle* parentStyle) const264 inline const RenderStyle* RenderText::getCachedPseudoStyle(PseudoId pseudoId, const RenderStyle* parentStyle) const 265 265 { 266 266 return parent()->getCachedPseudoStyle(pseudoId, parentStyle); -
trunk/Source/WebCore/rendering/RenderTextControl.cpp
r200041 r200098 66 66 // We may have set the width and the height in the old style in layout(). 67 67 // Reset them now to avoid getting a spurious layout hint. 68 innerTextRenderer-> style().setHeight(Length());69 innerTextRenderer-> style().setWidth(Length());68 innerTextRenderer->mutableStyle().setHeight(Length()); 69 innerTextRenderer->mutableStyle().setWidth(Length()); 70 70 innerTextRenderer->setStyle(textFormControlElement().createInnerTextStyle(style())); 71 71 } -
trunk/Source/WebCore/rendering/RenderTextControlMultiLine.cpp
r200041 r200098 93 93 if (is<RenderBox>(placeholderRenderer)) { 94 94 auto& placeholderBox = downcast<RenderBox>(*placeholderRenderer); 95 placeholderBox. style().setLogicalWidth(Length(contentLogicalWidth() - placeholderBox.borderAndPaddingLogicalWidth(), Fixed));95 placeholderBox.mutableStyle().setLogicalWidth(Length(contentLogicalWidth() - placeholderBox.borderAndPaddingLogicalWidth(), Fixed)); 96 96 placeholderBox.layoutIfNeeded(); 97 97 placeholderBox.setX(borderLeft() + paddingLeft()); -
trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp
r200041 r200098 109 109 // To ensure consistency between layouts, we need to reset any conditionally overriden height. 110 110 if (innerTextRenderer && !innerTextRenderer->style().logicalHeight().isAuto()) { 111 innerTextRenderer-> style().setLogicalHeight(Length(Auto));111 innerTextRenderer->mutableStyle().setLogicalHeight(Length(Auto)); 112 112 setNeedsLayoutOnAncestors(innerTextRenderer, this); 113 113 } 114 114 if (innerBlockRenderer && !innerBlockRenderer->style().logicalHeight().isAuto()) { 115 innerBlockRenderer-> style().setLogicalHeight(Length(Auto));115 innerBlockRenderer->mutableStyle().setLogicalHeight(Length(Auto)); 116 116 setNeedsLayoutOnAncestors(innerBlockRenderer, this); 117 117 } … … 129 129 setNeedsLayout(MarkOnlyThis); 130 130 131 innerTextRenderer-> style().setLogicalHeight(Length(desiredLogicalHeight, Fixed));131 innerTextRenderer->mutableStyle().setLogicalHeight(Length(desiredLogicalHeight, Fixed)); 132 132 innerTextRenderer->setNeedsLayout(MarkOnlyThis); 133 133 if (innerBlockRenderer) { 134 innerBlockRenderer-> style().setLogicalHeight(Length(desiredLogicalHeight, Fixed));134 innerBlockRenderer->mutableStyle().setLogicalHeight(Length(desiredLogicalHeight, Fixed)); 135 135 innerBlockRenderer->setNeedsLayout(MarkOnlyThis); 136 136 } … … 141 141 LayoutUnit containerLogicalHeight = containerRenderer->logicalHeight(); 142 142 if (containerLogicalHeight > logicalHeightLimit) { 143 containerRenderer-> style().setLogicalHeight(Length(logicalHeightLimit, Fixed));143 containerRenderer->mutableStyle().setLogicalHeight(Length(logicalHeightLimit, Fixed)); 144 144 setNeedsLayout(MarkOnlyThis); 145 145 } else if (containerRenderer->logicalHeight() < contentLogicalHeight()) { 146 containerRenderer-> style().setLogicalHeight(Length(contentLogicalHeight(), Fixed));146 containerRenderer->mutableStyle().setLogicalHeight(Length(contentLogicalHeight(), Fixed)); 147 147 setNeedsLayout(MarkOnlyThis); 148 148 } else 149 containerRenderer-> style().setLogicalHeight(Length(containerLogicalHeight, Fixed));149 containerRenderer->mutableStyle().setLogicalHeight(Length(containerLogicalHeight, Fixed)); 150 150 } 151 151 … … 175 175 if (innerTextRenderer) 176 176 innerTextSize = innerTextRenderer->size(); 177 placeholderBox-> style().setWidth(Length(innerTextSize.width() - placeholderBox->horizontalBorderAndPaddingExtent(), Fixed));178 placeholderBox-> style().setHeight(Length(innerTextSize.height() - placeholderBox->verticalBorderAndPaddingExtent(), Fixed));177 placeholderBox->mutableStyle().setWidth(Length(innerTextSize.width() - placeholderBox->horizontalBorderAndPaddingExtent(), Fixed)); 178 placeholderBox->mutableStyle().setHeight(Length(innerTextSize.height() - placeholderBox->verticalBorderAndPaddingExtent(), Fixed)); 179 179 bool neededLayout = placeholderBox->needsLayout(); 180 180 bool placeholderBoxHadLayout = placeholderBox->everHadLayout(); … … 203 203 // FIXME: We should not be adjusting styles during layout. <rdar://problem/7675493> 204 204 if (inputElement().isSearchField()) 205 RenderThemeIOS::adjustRoundBorderRadius( style(), *this);205 RenderThemeIOS::adjustRoundBorderRadius(mutableStyle(), *this); 206 206 #endif 207 207 } … … 237 237 // Reset them now to avoid getting a spurious layout hint. 238 238 HTMLElement* innerBlock = innerBlockElement(); 239 if ( RenderObject* innerBlockRenderer = innerBlock ? innerBlock->renderer() : 0) {240 innerBlockRenderer-> style().setHeight(Length());241 innerBlockRenderer-> style().setWidth(Length());239 if (auto* innerBlockRenderer = innerBlock ? innerBlock->renderer() : nullptr) { 240 innerBlockRenderer->mutableStyle().setHeight(Length()); 241 innerBlockRenderer->mutableStyle().setWidth(Length()); 242 242 } 243 243 HTMLElement* container = containerElement(); 244 if ( RenderObject* containerRenderer = container ? container->renderer() : 0) {245 containerRenderer-> style().setHeight(Length());246 containerRenderer-> style().setWidth(Length());244 if (auto* containerRenderer = container ? container->renderer() : nullptr) { 245 containerRenderer->mutableStyle().setHeight(Length()); 246 containerRenderer->mutableStyle().setWidth(Length()); 247 247 } 248 248 if (diff == StyleDifferenceLayout) { -
trunk/Source/WebCore/rendering/RenderTextFragment.cpp
r179691 r200098 69 69 70 70 if (RenderBlock* block = blockForAccompanyingFirstLetter()) { 71 block-> style().removeCachedPseudoStyle(FIRST_LETTER);71 block->mutableStyle().removeCachedPseudoStyle(FIRST_LETTER); 72 72 block->updateFirstLetter(); 73 73 } -
trunk/Source/WebCore/rendering/RenderThemeGtk.cpp
r199659 r200098 2016 2016 #endif 2017 2017 2018 static FloatRoundedRect::Radii borderRadiiFromStyle( RenderStyle& style)2018 static FloatRoundedRect::Radii borderRadiiFromStyle(const RenderStyle& style) 2019 2019 { 2020 2020 return FloatRoundedRect::Radii( … … 2037 2037 float mediaDuration = mediaElement->duration(); 2038 2038 float totalTrackWidth = r.width(); 2039 RenderStyle& style = o.style();2039 auto& style = o.style(); 2040 2040 RefPtr<TimeRanges> timeRanges = mediaElement->buffered(); 2041 2041 for (unsigned index = 0; index < timeRanges->length(); ++index) { … … 2060 2060 bool RenderThemeGtk::paintMediaSliderThumb(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r) 2061 2061 { 2062 RenderStyle& style = o.style();2062 auto& style = o.style(); 2063 2063 paintInfo.context().fillRoundedRect(FloatRoundedRect(r, borderRadiiFromStyle(style)), style.visitedDependentColor(CSSPropertyColor)); 2064 2064 return false; … … 2081 2081 int rectHeight = rect.height(); 2082 2082 float trackHeight = rectHeight * volume; 2083 RenderStyle& style = renderObject.style();2083 auto& style = renderObject.style(); 2084 2084 IntRect volumeRect(rect); 2085 2085 volumeRect.move(0, rectHeight - trackHeight); -
trunk/Source/WebCore/rendering/RenderThemeIOS.mm
r199640 r200098 337 337 // To fix inner border bleeding issues <rdar://problem/9812507>, we clip to the outer border and assert that 338 338 // the border is opaque or transparent, unless we're checked because checked radio/checkboxes show no bleeding. 339 RenderStyle& style = box.style();339 auto& style = box.style(); 340 340 RoundedRect border = isChecked(box) ? style.getRoundedInnerBorderFor(rect) : style.getRoundedBorderFor(rect); 341 341 … … 500 500 bool RenderThemeIOS::paintTextFieldDecorations(const RenderObject& box, const PaintInfo& paintInfo, const FloatRect& rect) 501 501 { 502 RenderStyle& style = box.style();502 auto& style = box.style(); 503 503 FloatPoint point(rect.x() + style.borderLeftWidth(), rect.y() + style.borderTopWidth()); 504 504 … … 631 631 bool RenderThemeIOS::paintMenuListButtonDecorations(const RenderBox& box, const PaintInfo& paintInfo, const FloatRect& rect) 632 632 { 633 RenderStyle& style = box.style();633 auto& style = box.style(); 634 634 float borderTopWidth = style.borderTopWidth(); 635 635 FloatRect clip(rect.x() + style.borderLeftWidth(), rect.y() + style.borderTopWidth(), rect.width() - style.borderLeftWidth() - style.borderRightWidth(), rect.height() - style.borderTopWidth() - style.borderBottomWidth()); … … 735 735 { 736 736 IntRect trackClip = rect; 737 RenderStyle& style = box.style();737 auto& style = box.style(); 738 738 739 739 bool isHorizontal = true; -
trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp
r199516 r200098 85 85 return; 86 86 87 RenderStyle& style = flow.style();87 auto& style = flow.style(); 88 88 if (style.visibility() != VISIBLE) 89 89 return; … … 141 141 return false; 142 142 143 RenderStyle& style = flow.style();143 auto& style = flow.style(); 144 144 if (style.visibility() != VISIBLE || style.pointerEvents() == PE_NONE) 145 145 return false; -
trunk/Source/WebCore/rendering/TextAutoSizing.cpp
r200041 r200098 52 52 } 53 53 54 TextAutoSizingKey::TextAutoSizingKey( RenderStyle* style)54 TextAutoSizingKey::TextAutoSizingKey(const RenderStyle* style) 55 55 : m_style(style ? RenderStyle::clonePtr(*style) : nullptr) 56 56 { -
trunk/Source/WebCore/rendering/TextAutoSizing.h
r199964 r200098 44 44 enum DeletedTag { Deleted }; 45 45 explicit TextAutoSizingKey(DeletedTag); 46 explicit TextAutoSizingKey( RenderStyle*);46 explicit TextAutoSizingKey(const RenderStyle*); 47 47 TextAutoSizingKey(TextAutoSizingKey&&) = default; 48 48 49 49 TextAutoSizingKey& operator=(TextAutoSizingKey&&) = default; 50 50 51 RenderStyle* style() const { return m_style.get(); }51 const RenderStyle* style() const { return m_style.get(); } 52 52 inline bool isDeleted() const { return m_isDeleted; } 53 53 -
trunk/Source/WebCore/rendering/TextPaintStyle.cpp
r192140 r200098 137 137 } 138 138 139 if ( RenderStyle* pseudoStyle = renderer.getCachedPseudoStyle(SELECTION)) {139 if (auto* pseudoStyle = renderer.getCachedPseudoStyle(SELECTION)) { 140 140 const ShadowData* shadow = paintInfo.forceTextColor() ? nullptr : pseudoStyle->textShadow(); 141 141 if (shadow != selectionShadow) { -
trunk/Source/WebCore/rendering/line/BreakingContext.h
r199818 r200098 253 253 // very specific circumstances (in order to match common WinIE renderings). 254 254 // Not supporting the quirk has caused us to mis-render some real sites. (See Bugzilla 10517.) 255 RenderStyle& m_blockStyle;255 const RenderStyle& m_blockStyle; 256 256 257 257 LineInfo& m_lineInfo; -
trunk/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp
r200041 r200098 302 302 indexTopMargin = 0; 303 303 } 304 index-> style().setMarginTop(Length(indexTopMargin, Fixed));305 } 306 radical-> style().setMarginTop(Length(radicalTopMargin, Fixed));307 base-> style().setMarginTop(Length(baseTopMargin, Fixed));304 index->mutableStyle().setMarginTop(Length(indexTopMargin, Fixed)); 305 } 306 radical->mutableStyle().setMarginTop(Length(radicalTopMargin, Fixed)); 307 base->mutableStyle().setMarginTop(Length(baseTopMargin, Fixed)); 308 308 } 309 309 -
trunk/Source/WebCore/rendering/style/RenderStyle.h
r200041 r200098 1607 1607 void resetColumnRule() { SET_NESTED_VAR(rareNonInheritedData, m_multiCol, m_rule, BorderValue()); } 1608 1608 void setColumnSpan(ColumnSpan columnSpan) { SET_NESTED_VAR(rareNonInheritedData, m_multiCol, m_columnSpan, columnSpan); } 1609 void inheritColumnPropertiesFrom( RenderStyle* parent) { rareNonInheritedData.access()->m_multiCol = parent->rareNonInheritedData->m_multiCol; }1609 void inheritColumnPropertiesFrom(const RenderStyle* parent) { rareNonInheritedData.access()->m_multiCol = parent->rareNonInheritedData->m_multiCol; } 1610 1610 void setTransform(const TransformOperations& ops) { SET_NESTED_VAR(rareNonInheritedData, m_transform, m_operations, ops); } 1611 1611 void setTransformOriginX(Length length) { SET_NESTED_VAR(rareNonInheritedData, m_transform, m_x, WTFMove(length)); } -
trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp
r199307 r200098 108 108 } 109 109 110 FloatRect SVGInlineTextBox::selectionRectForTextFragment(const SVGTextFragment& fragment, int startPosition, int endPosition, RenderStyle* style) const110 FloatRect SVGInlineTextBox::selectionRectForTextFragment(const SVGTextFragment& fragment, int startPosition, int endPosition, const RenderStyle* style) const 111 111 { 112 112 ASSERT_WITH_SECURITY_IMPLICATION(startPosition < endPosition); … … 143 143 return LayoutRect(); 144 144 145 RenderStyle& style = renderer().style();145 auto& style = renderer().style(); 146 146 147 147 AffineTransform fragmentTransform; … … 202 202 return; 203 203 204 RenderStyle& style = parentRenderer.style();204 auto& style = parentRenderer.style(); 205 205 206 206 int startPosition; … … 257 257 return; 258 258 259 RenderStyle& style = parentRenderer.style();259 auto& style = parentRenderer.style(); 260 260 261 261 const SVGRenderStyle& svgStyle = style.svgStyle(); … … 264 264 bool hasVisibleStroke = svgStyle.hasVisibleStroke(); 265 265 266 RenderStyle* selectionStyle = &style;266 const RenderStyle* selectionStyle = &style; 267 267 if (hasSelection) { 268 268 selectionStyle = parentRenderer.getCachedPseudoStyle(SELECTION); … … 335 335 } 336 336 337 bool SVGInlineTextBox::acquirePaintingResource(GraphicsContext*& context, float scalingFactor, RenderBoxModelObject& renderer, RenderStyle* style)337 bool SVGInlineTextBox::acquirePaintingResource(GraphicsContext*& context, float scalingFactor, RenderBoxModelObject& renderer, const RenderStyle* style) 338 338 { 339 339 ASSERT(scalingFactor); … … 378 378 } 379 379 380 bool SVGInlineTextBox::prepareGraphicsContextForTextPainting(GraphicsContext*& context, float scalingFactor, RenderStyle* style)380 bool SVGInlineTextBox::prepareGraphicsContextForTextPainting(GraphicsContext*& context, float scalingFactor, const RenderStyle* style) 381 381 { 382 382 return acquirePaintingResource(context, scalingFactor, parent()->renderer(), style); … … 388 388 } 389 389 390 TextRun SVGInlineTextBox::constructTextRun( RenderStyle* style, const SVGTextFragment& fragment) const390 TextRun SVGInlineTextBox::constructTextRun(const RenderStyle* style, const SVGTextFragment& fragment) const 391 391 { 392 392 ASSERT(style); … … 507 507 ASSERT(m_paintingResourceMode != ApplyToDefaultMode); 508 508 509 RenderStyle& decorationStyle = decorationRenderer.style();509 auto& decorationStyle = decorationRenderer.style(); 510 510 511 511 float scalingFactor = 1; … … 541 541 } 542 542 543 void SVGInlineTextBox::paintTextWithShadows(GraphicsContext& context, RenderStyle* style, TextRun& textRun, const SVGTextFragment& fragment, int startPosition, int endPosition)543 void SVGInlineTextBox::paintTextWithShadows(GraphicsContext& context, const RenderStyle* style, TextRun& textRun, const SVGTextFragment& fragment, int startPosition, int endPosition) 544 544 { 545 545 float scalingFactor = renderer().scalingFactor(); … … 586 586 } 587 587 588 void SVGInlineTextBox::paintText(GraphicsContext& context, RenderStyle* style,RenderStyle* selectionStyle, const SVGTextFragment& fragment, bool hasSelection, bool paintSelectedTextOnly)588 void SVGInlineTextBox::paintText(GraphicsContext& context, const RenderStyle* style, const RenderStyle* selectionStyle, const SVGTextFragment& fragment, bool hasSelection, bool paintSelectedTextOnly) 589 589 { 590 590 ASSERT(style); -
trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.h
r198074 r200098 65 65 66 66 int offsetForPositionInFragment(const SVGTextFragment&, float position, bool includePartialGlyphs) const; 67 FloatRect selectionRectForTextFragment(const SVGTextFragment&, int fragmentStartPosition, int fragmentEndPosition, RenderStyle*) const;67 FloatRect selectionRectForTextFragment(const SVGTextFragment&, int fragmentStartPosition, int fragmentEndPosition, const RenderStyle*) const; 68 68 69 69 private: 70 70 bool isSVGInlineTextBox() const override { return true; } 71 71 72 TextRun constructTextRun( RenderStyle*, const SVGTextFragment&) const;72 TextRun constructTextRun(const RenderStyle*, const SVGTextFragment&) const; 73 73 74 bool acquirePaintingResource(GraphicsContext*&, float scalingFactor, RenderBoxModelObject&, RenderStyle*);74 bool acquirePaintingResource(GraphicsContext*&, float scalingFactor, RenderBoxModelObject&, const RenderStyle*); 75 75 void releasePaintingResource(GraphicsContext*&, const Path*); 76 76 77 bool prepareGraphicsContextForTextPainting(GraphicsContext*&, float scalingFactor, RenderStyle*);77 bool prepareGraphicsContextForTextPainting(GraphicsContext*&, float scalingFactor, const RenderStyle*); 78 78 void restoreGraphicsContextAfterTextPainting(GraphicsContext*&); 79 79 80 80 void paintDecoration(GraphicsContext&, TextDecoration, const SVGTextFragment&); 81 81 void paintDecorationWithStyle(GraphicsContext&, TextDecoration, const SVGTextFragment&, RenderBoxModelObject& decorationRenderer); 82 void paintTextWithShadows(GraphicsContext&, RenderStyle*, TextRun&, const SVGTextFragment&, int startPosition, int endPosition);83 void paintText(GraphicsContext&, RenderStyle*,RenderStyle* selectionStyle, const SVGTextFragment&, bool hasSelection, bool paintSelectedTextOnly);82 void paintTextWithShadows(GraphicsContext&, const RenderStyle*, TextRun&, const SVGTextFragment&, int startPosition, int endPosition); 83 void paintText(GraphicsContext&, const RenderStyle*, const RenderStyle* selectionStyle, const SVGTextFragment&, bool hasSelection, bool paintSelectedTextOnly); 84 84 85 85 bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit lineTop, LayoutUnit lineBottom, HitTestAction) override; -
trunk/Source/WebCore/rendering/svg/SVGPathData.cpp
r173921 r200098 46 46 if (!renderer) 47 47 return; 48 RenderStyle& style = renderer->style();48 auto& style = renderer->style(); 49 49 float r = lengthContext.valueForLength(style.svgStyle().r()); 50 50 if (r > 0) { … … 60 60 if (!renderer) 61 61 return; 62 RenderStyle& style = renderer->style();62 auto& style = renderer->style(); 63 63 SVGLengthContext lengthContext(element); 64 64 float rx = lengthContext.valueForLength(style.svgStyle().rx(), LengthModeWidth); … … 121 121 return; 122 122 123 RenderStyle& style = renderer->style();123 auto& style = renderer->style(); 124 124 SVGLengthContext lengthContext(element); 125 125 float width = lengthContext.valueForLength(style.width(), LengthModeWidth); -
trunk/Source/WebCore/rendering/svg/SVGRenderingContext.cpp
r198075 r200098 91 91 } 92 92 93 RenderStyle& style = m_renderer->style();93 auto& style = m_renderer->style(); 94 94 95 95 const SVGRenderStyle& svgStyle = style.svgStyle(); -
trunk/Source/WebCore/style/StyleTreeResolver.cpp
r200041 r200098 94 94 } 95 95 96 TreeResolver::Parent::Parent(Element& element, RenderStyle& style, Change change)96 TreeResolver::Parent::Parent(Element& element, const RenderStyle& style, Change change) 97 97 : element(&element) 98 98 , style(style) … … 120 120 } 121 121 122 std::unique_ptr<RenderStyle> TreeResolver::styleForElement(Element& element, RenderStyle& inheritedStyle)122 std::unique_ptr<RenderStyle> TreeResolver::styleForElement(Element& element, const RenderStyle& inheritedStyle) 123 123 { 124 124 if (!m_document.haveStylesheetsLoaded() && !element.renderer()) { … … 236 236 return VISIBLE; 237 237 238 RenderStyle& style = renderer->style();238 auto& style = renderer->style(); 239 239 240 240 Length width(style.width()); … … 255 255 class CheckForVisibilityChangeOnRecalcStyle { 256 256 public: 257 CheckForVisibilityChangeOnRecalcStyle(Element* element, RenderStyle* currentStyle)257 CheckForVisibilityChangeOnRecalcStyle(Element* element, const RenderStyle* currentStyle) 258 258 : m_element(element) 259 259 , m_previousDisplay(currentStyle ? currentStyle->display() : NONE) … … 268 268 if (m_element->isInUserAgentShadowTree()) 269 269 return; 270 RenderStyle* style = m_element->renderStyle();270 auto* style = m_element->renderStyle(); 271 271 if (!style) 272 272 return; … … 283 283 #endif // PLATFORM(IOS) 284 284 285 void TreeResolver::pushParent(Element& element, RenderStyle& style, Change change)285 void TreeResolver::pushParent(Element& element, const RenderStyle& style, Change change) 286 286 { 287 287 scope().selectorFilter.pushParent(&element); … … 376 376 bool shouldResolveForPseudoElement = shouldResolvePseudoElement(element.beforePseudoElement()) || shouldResolvePseudoElement(element.afterPseudoElement()); 377 377 378 RenderStyle* style;378 const RenderStyle* style; 379 379 Change change; 380 380 -
trunk/Source/WebCore/style/StyleTreeResolver.h
r199964 r200098 62 62 63 63 private: 64 std::unique_ptr<RenderStyle> styleForElement(Element&, RenderStyle& inheritedStyle);64 std::unique_ptr<RenderStyle> styleForElement(Element&, const RenderStyle& inheritedStyle); 65 65 66 66 void resolveComposedTree(); … … 80 80 struct Parent { 81 81 Element* element; 82 RenderStyle& style;82 const RenderStyle& style; 83 83 Change change; 84 84 bool didPushScope { false }; … … 86 86 87 87 Parent(Document&, Change); 88 Parent(Element&, RenderStyle&, Change);88 Parent(Element&, const RenderStyle&, Change); 89 89 }; 90 90 … … 96 96 void popScope(); 97 97 98 void pushParent(Element&, RenderStyle&, Change);98 void pushParent(Element&, const RenderStyle&, Change); 99 99 void popParent(); 100 100 void popParentsToDepth(unsigned depth); -
trunk/Source/WebCore/style/StyleUpdate.cpp
r199964 r200098 62 62 } 63 63 64 RenderStyle* Update::elementStyle(const Element& element) const64 const RenderStyle* Update::elementStyle(const Element& element) const 65 65 { 66 66 if (auto* update = elementUpdate(element)) 67 67 return update->style.get(); 68 return element.renderStyle(); 68 auto* renderer = element.renderer(); 69 if (!renderer) 70 return nullptr; 71 return &renderer->style(); 72 } 73 74 RenderStyle* Update::elementStyle(const Element& element) 75 { 76 if (auto* update = elementUpdate(element)) 77 return update->style.get(); 78 auto* renderer = element.renderer(); 79 if (!renderer) 80 return nullptr; 81 return &renderer->mutableStyle(); 69 82 } 70 83 -
trunk/Source/WebCore/style/StyleUpdate.h
r199964 r200098 64 64 bool textUpdate(const Text&) const; 65 65 66 RenderStyle* elementStyle(const Element&) const; 66 const RenderStyle* elementStyle(const Element&) const; 67 RenderStyle* elementStyle(const Element&); 67 68 68 69 const Document& document() const { return m_document; } -
trunk/Source/WebCore/svg/SVGElement.cpp
r199625 r200098 747 747 } 748 748 749 Optional<ElementStyle> SVGElement::resolveCustomStyle( RenderStyle& parentStyle,RenderStyle*)749 Optional<ElementStyle> SVGElement::resolveCustomStyle(const RenderStyle& parentStyle, const RenderStyle*) 750 750 { 751 751 // If the element is in a <use> tree we get the style from the definition tree. … … 774 774 } 775 775 776 RenderStyle* SVGElement::computedStyle(PseudoId pseudoElementSpecifier)776 const RenderStyle* SVGElement::computedStyle(PseudoId pseudoElementSpecifier) 777 777 { 778 778 if (!m_svgRareData || !m_svgRareData->useOverrideComputedStyle()) 779 779 return Element::computedStyle(pseudoElementSpecifier); 780 780 781 RenderStyle* parentStyle = nullptr;781 const RenderStyle* parentStyle = nullptr; 782 782 if (Element* parent = parentOrShadowHostElement()) { 783 783 if (auto renderer = parent->renderer()) -
trunk/Source/WebCore/svg/SVGElement.h
r199625 r200098 113 113 static void synchronizeAllAnimatedSVGAttribute(SVGElement*); 114 114 115 Optional<ElementStyle> resolveCustomStyle( RenderStyle& parentStyle,RenderStyle* shadowHostStyle) override;115 Optional<ElementStyle> resolveCustomStyle(const RenderStyle& parentStyle, const RenderStyle* shadowHostStyle) override; 116 116 117 117 static void synchronizeRequiredFeatures(SVGElement* contextElement); … … 182 182 183 183 private: 184 RenderStyle* computedStyle(PseudoId = NOPSEUDO) final;184 const RenderStyle* computedStyle(PseudoId = NOPSEUDO) final; 185 185 186 186 virtual bool isSupported(StringImpl* feature, StringImpl* version) const; -
trunk/Source/WebCore/svg/SVGElementRareData.h
r199964 r200098 60 60 } 61 61 62 RenderStyle* overrideComputedStyle(Element& element,RenderStyle* parentStyle)62 const RenderStyle* overrideComputedStyle(Element& element, const RenderStyle* parentStyle) 63 63 { 64 64 if (!m_useOverrideComputedStyle) 65 return 0;65 return nullptr; 66 66 if (!m_overrideComputedStyle || m_needsOverrideComputedStyleUpdate) { 67 67 // The style computed here contains no CSS Animations/Transitions or SMIL induced rules - this is needed to compute the "base value" for the SMIL animation sandwhich model. -
trunk/Source/WebCore/svg/SVGGraphicsElement.cpp
r200041 r200098 64 64 { 65 65 AffineTransform matrix; 66 RenderStyle* style = renderer() ? &renderer()->style() : nullptr;66 auto* style = renderer() ? &renderer()->style() : nullptr; 67 67 68 68 // If CSS property was set, use that, otherwise fallback to attribute (if set). -
trunk/Source/WebCore/svg/SVGLengthContext.cpp
r184055 r200098 223 223 } 224 224 225 static inline RenderStyle* renderStyleForLengthResolving(const SVGElement* context)225 static inline const RenderStyle* renderStyleForLengthResolving(const SVGElement* context) 226 226 { 227 227 if (!context) … … 237 237 // There must be at least a RenderSVGRoot renderer, carrying a style. 238 238 ASSERT_NOT_REACHED(); 239 return 0;239 return nullptr; 240 240 } 241 241 242 242 float SVGLengthContext::convertValueFromUserUnitsToEMS(float value, ExceptionCode& ec) const 243 243 { 244 RenderStyle* style = renderStyleForLengthResolving(m_context);244 auto* style = renderStyleForLengthResolving(m_context); 245 245 if (!style) { 246 246 ec = NOT_SUPPORTED_ERR; … … 259 259 float SVGLengthContext::convertValueFromEMSToUserUnits(float value, ExceptionCode& ec) const 260 260 { 261 RenderStyle* style = renderStyleForLengthResolving(m_context);261 auto* style = renderStyleForLengthResolving(m_context); 262 262 if (!style) { 263 263 ec = NOT_SUPPORTED_ERR; … … 270 270 float SVGLengthContext::convertValueFromUserUnitsToEXS(float value, ExceptionCode& ec) const 271 271 { 272 RenderStyle* style = renderStyleForLengthResolving(m_context);272 auto* style = renderStyleForLengthResolving(m_context); 273 273 if (!style) { 274 274 ec = NOT_SUPPORTED_ERR; … … 289 289 float SVGLengthContext::convertValueFromEXSToUserUnits(float value, ExceptionCode& ec) const 290 290 { 291 RenderStyle* style = renderStyleForLengthResolving(m_context);291 auto* style = renderStyleForLengthResolving(m_context); 292 292 if (!style) { 293 293 ec = NOT_SUPPORTED_ERR; -
trunk/Source/WebCore/svg/SVGStopElement.cpp
r200041 r200098 89 89 Color SVGStopElement::stopColorIncludingOpacity() const 90 90 { 91 RenderStyle* style = renderer() ? &renderer()->style() : nullptr;91 auto* style = renderer() ? &renderer()->style() : nullptr; 92 92 // FIXME: This check for null style exists to address Bug WK 90814, a rare crash condition in 93 93 // which the renderer or style is null. This entire class is scheduled for removal (Bug WK 86941) -
trunk/Source/WebCore/svg/SVGTextElement.cpp
r200041 r200098 46 46 { 47 47 AffineTransform matrix; 48 RenderStyle* style = renderer() ? &renderer()->style() : nullptr;48 auto* style = renderer() ? &renderer()->style() : nullptr; 49 49 50 50 // if CSS property was set, use that, otherwise fallback to attribute (if set) -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r199955 r200098 824 824 if (!selection.isNone()) { 825 825 Node* nodeToRemove; 826 if ( RenderStyle* style = Editor::styleForSelectionStart(&frame, nodeToRemove)) {826 if (auto* style = Editor::styleForSelectionStart(&frame, nodeToRemove)) { 827 827 if (style->fontCascade().weight() >= FontWeightBold) 828 828 postLayoutData.typingAttributes |= AttributeBold; -
trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm
r199955 r200098 825 825 return FloatQuad(); 826 826 827 RenderStyle& style = renderer->style();827 auto& style = renderer->style(); 828 828 IntRect boundingBox = renderer->absoluteBoundingBoxRect(true /* use transforms*/); 829 829
Note: See TracChangeset
for help on using the changeset viewer.