Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Side by Side Diff: Source/core/rendering/style/RenderStyle.cpp

Issue 217563003: Turn styleWillChange |newStyle| into a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. 4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 if (width.isIntrinsicOrAuto() 360 if (width.isIntrinsicOrAuto()
361 && ((!a.left().isIntrinsicOrAuto() && a.left() != b.left()) 361 && ((!a.left().isIntrinsicOrAuto() && a.left() != b.left())
362 || (!a.right().isIntrinsicOrAuto() && a.right() != b.right()))) 362 || (!a.right().isIntrinsicOrAuto() && a.right() != b.right())))
363 return false; 363 return false;
364 364
365 // One of the units is fixed or percent in both directions and stayed 365 // One of the units is fixed or percent in both directions and stayed
366 // that way in the new style. Therefore all we are doing is moving. 366 // that way in the new style. Therefore all we are doing is moving.
367 return true; 367 return true;
368 } 368 }
369 369
370 StyleDifference RenderStyle::visualInvalidationDiff(const RenderStyle* other, un signed& changedContextSensitiveProperties) const 370 StyleDifference RenderStyle::visualInvalidationDiff(const RenderStyle& other, un signed& changedContextSensitiveProperties) const
371 { 371 {
372 changedContextSensitiveProperties = ContextSensitivePropertyNone; 372 changedContextSensitiveProperties = ContextSensitivePropertyNone;
373 373
374 // Note, we use .get() on each DataRef below because DataRef::operator== wil l do a deep 374 // Note, we use .get() on each DataRef below because DataRef::operator== wil l do a deep
375 // compare, which is duplicate work when we're going to compare each propert y inside 375 // compare, which is duplicate work when we're going to compare each propert y inside
376 // this function anyway. 376 // this function anyway.
377 377
378 StyleDifference svgChange = StyleDifferenceEqual; 378 StyleDifference svgChange = StyleDifferenceEqual;
379 if (m_svgStyle.get() != other->m_svgStyle.get()) { 379 if (m_svgStyle.get() != other.m_svgStyle.get()) {
380 svgChange = m_svgStyle->diff(other->m_svgStyle.get()); 380 svgChange = m_svgStyle->diff(other.m_svgStyle.get());
381 if (svgChange == StyleDifferenceLayout) 381 if (svgChange == StyleDifferenceLayout)
382 return svgChange; 382 return svgChange;
383 } 383 }
384 384
385 if (m_box.get() != other->m_box.get()) { 385 if (m_box.get() != other.m_box.get()) {
386 if (m_box->width() != other->m_box->width() 386 if (m_box->width() != other.m_box->width()
387 || m_box->minWidth() != other->m_box->minWidth() 387 || m_box->minWidth() != other.m_box->minWidth()
388 || m_box->maxWidth() != other->m_box->maxWidth() 388 || m_box->maxWidth() != other.m_box->maxWidth()
389 || m_box->height() != other->m_box->height() 389 || m_box->height() != other.m_box->height()
390 || m_box->minHeight() != other->m_box->minHeight() 390 || m_box->minHeight() != other.m_box->minHeight()
391 || m_box->maxHeight() != other->m_box->maxHeight()) 391 || m_box->maxHeight() != other.m_box->maxHeight())
392 return StyleDifferenceLayout; 392 return StyleDifferenceLayout;
393 393
394 if (m_box->verticalAlign() != other->m_box->verticalAlign()) 394 if (m_box->verticalAlign() != other.m_box->verticalAlign())
395 return StyleDifferenceLayout; 395 return StyleDifferenceLayout;
396 396
397 if (m_box->boxSizing() != other->m_box->boxSizing()) 397 if (m_box->boxSizing() != other.m_box->boxSizing())
398 return StyleDifferenceLayout; 398 return StyleDifferenceLayout;
399 } 399 }
400 400
401 if (surround.get() != other->surround.get()) { 401 if (surround.get() != other.surround.get()) {
402 if (surround->margin != other->surround->margin) 402 if (surround->margin != other.surround->margin)
403 return StyleDifferenceLayout; 403 return StyleDifferenceLayout;
404 404
405 if (surround->padding != other->surround->padding) 405 if (surround->padding != other.surround->padding)
406 return StyleDifferenceLayout; 406 return StyleDifferenceLayout;
407 407
408 // If our border widths change, then we need to layout. Other changes to borders only necessitate a repaint. 408 // If our border widths change, then we need to layout. Other changes to borders only necessitate a repaint.
409 if (borderLeftWidth() != other->borderLeftWidth() 409 if (borderLeftWidth() != other.borderLeftWidth()
410 || borderTopWidth() != other->borderTopWidth() 410 || borderTopWidth() != other.borderTopWidth()
411 || borderBottomWidth() != other->borderBottomWidth() 411 || borderBottomWidth() != other.borderBottomWidth()
412 || borderRightWidth() != other->borderRightWidth()) 412 || borderRightWidth() != other.borderRightWidth())
413 return StyleDifferenceLayout; 413 return StyleDifferenceLayout;
414 } 414 }
415 415
416 if (rareNonInheritedData.get() != other->rareNonInheritedData.get()) { 416 if (rareNonInheritedData.get() != other.rareNonInheritedData.get()) {
417 if (rareNonInheritedData->m_appearance != other->rareNonInheritedData->m _appearance 417 if (rareNonInheritedData->m_appearance != other.rareNonInheritedData->m_ appearance
418 || rareNonInheritedData->marginBeforeCollapse != other->rareNonInher itedData->marginBeforeCollapse 418 || rareNonInheritedData->marginBeforeCollapse != other.rareNonInheri tedData->marginBeforeCollapse
419 || rareNonInheritedData->marginAfterCollapse != other->rareNonInheri tedData->marginAfterCollapse 419 || rareNonInheritedData->marginAfterCollapse != other.rareNonInherit edData->marginAfterCollapse
420 || rareNonInheritedData->lineClamp != other->rareNonInheritedData->l ineClamp 420 || rareNonInheritedData->lineClamp != other.rareNonInheritedData->li neClamp
421 || rareNonInheritedData->textOverflow != other->rareNonInheritedData ->textOverflow 421 || rareNonInheritedData->textOverflow != other.rareNonInheritedData- >textOverflow
422 || rareNonInheritedData->m_wrapFlow != other->rareNonInheritedData-> m_wrapFlow 422 || rareNonInheritedData->m_wrapFlow != other.rareNonInheritedData->m _wrapFlow
423 || rareNonInheritedData->m_wrapThrough != other->rareNonInheritedDat a->m_wrapThrough 423 || rareNonInheritedData->m_wrapThrough != other.rareNonInheritedData ->m_wrapThrough
424 || rareNonInheritedData->m_shapeMargin != other->rareNonInheritedDat a->m_shapeMargin 424 || rareNonInheritedData->m_shapeMargin != other.rareNonInheritedData ->m_shapeMargin
425 || rareNonInheritedData->m_shapePadding != other->rareNonInheritedDa ta->m_shapePadding 425 || rareNonInheritedData->m_shapePadding != other.rareNonInheritedDat a->m_shapePadding
426 || rareNonInheritedData->m_order != other->rareNonInheritedData->m_o rder 426 || rareNonInheritedData->m_order != other.rareNonInheritedData->m_or der
427 || rareNonInheritedData->m_alignContent != other->rareNonInheritedDa ta->m_alignContent 427 || rareNonInheritedData->m_alignContent != other.rareNonInheritedDat a->m_alignContent
428 || rareNonInheritedData->m_alignItems != other->rareNonInheritedData ->m_alignItems 428 || rareNonInheritedData->m_alignItems != other.rareNonInheritedData- >m_alignItems
429 || rareNonInheritedData->m_alignSelf != other->rareNonInheritedData- >m_alignSelf 429 || rareNonInheritedData->m_alignSelf != other.rareNonInheritedData-> m_alignSelf
430 || rareNonInheritedData->m_justifyContent != other->rareNonInherited Data->m_justifyContent 430 || rareNonInheritedData->m_justifyContent != other.rareNonInheritedD ata->m_justifyContent
431 || rareNonInheritedData->m_grid.get() != other->rareNonInheritedData ->m_grid.get() 431 || rareNonInheritedData->m_grid.get() != other.rareNonInheritedData- >m_grid.get()
432 || rareNonInheritedData->m_gridItem.get() != other->rareNonInherited Data->m_gridItem.get() 432 || rareNonInheritedData->m_gridItem.get() != other.rareNonInheritedD ata->m_gridItem.get()
433 || rareNonInheritedData->m_textCombine != other->rareNonInheritedDat a->m_textCombine 433 || rareNonInheritedData->m_textCombine != other.rareNonInheritedData ->m_textCombine
434 || rareNonInheritedData->hasFilters() != other->rareNonInheritedData ->hasFilters()) 434 || rareNonInheritedData->hasFilters() != other.rareNonInheritedData- >hasFilters())
435 return StyleDifferenceLayout; 435 return StyleDifferenceLayout;
436 436
437 if (rareNonInheritedData->m_deprecatedFlexibleBox.get() != other->rareNo nInheritedData->m_deprecatedFlexibleBox.get() 437 if (rareNonInheritedData->m_deprecatedFlexibleBox.get() != other.rareNon InheritedData->m_deprecatedFlexibleBox.get()
438 && *rareNonInheritedData->m_deprecatedFlexibleBox.get() != *other->r areNonInheritedData->m_deprecatedFlexibleBox.get()) 438 && *rareNonInheritedData->m_deprecatedFlexibleBox.get() != *other.ra reNonInheritedData->m_deprecatedFlexibleBox.get())
439 return StyleDifferenceLayout; 439 return StyleDifferenceLayout;
440 440
441 if (rareNonInheritedData->m_flexibleBox.get() != other->rareNonInherited Data->m_flexibleBox.get() 441 if (rareNonInheritedData->m_flexibleBox.get() != other.rareNonInheritedD ata->m_flexibleBox.get()
442 && *rareNonInheritedData->m_flexibleBox.get() != *other->rareNonInhe ritedData->m_flexibleBox.get()) 442 && *rareNonInheritedData->m_flexibleBox.get() != *other.rareNonInher itedData->m_flexibleBox.get())
443 return StyleDifferenceLayout; 443 return StyleDifferenceLayout;
444 444
445 // FIXME: We should add an optimized form of layout that just recomputes visual overflow. 445 // FIXME: We should add an optimized form of layout that just recomputes visual overflow.
446 if (!rareNonInheritedData->shadowDataEquivalent(*other->rareNonInherited Data.get())) 446 if (!rareNonInheritedData->shadowDataEquivalent(*other.rareNonInheritedD ata.get()))
447 return StyleDifferenceLayout; 447 return StyleDifferenceLayout;
448 448
449 if (!rareNonInheritedData->reflectionDataEquivalent(*other->rareNonInher itedData.get())) 449 if (!rareNonInheritedData->reflectionDataEquivalent(*other.rareNonInheri tedData.get()))
450 return StyleDifferenceLayout; 450 return StyleDifferenceLayout;
451 451
452 if (rareNonInheritedData->m_multiCol.get() != other->rareNonInheritedDat a->m_multiCol.get() 452 if (rareNonInheritedData->m_multiCol.get() != other.rareNonInheritedData ->m_multiCol.get()
453 && *rareNonInheritedData->m_multiCol.get() != *other->rareNonInherit edData->m_multiCol.get()) 453 && *rareNonInheritedData->m_multiCol.get() != *other.rareNonInherite dData->m_multiCol.get())
454 return StyleDifferenceLayout; 454 return StyleDifferenceLayout;
455 455
456 if (!transformDataEquivalent(other)) { 456 if (!transformDataEquivalent(other)) {
457 // Don't return early here; instead take note of the type of 457 // Don't return early here; instead take note of the type of
458 // change, and deal with it when looking at compositing. 458 // change, and deal with it when looking at compositing.
459 changedContextSensitiveProperties |= ContextSensitivePropertyTransfo rm; 459 changedContextSensitiveProperties |= ContextSensitivePropertyTransfo rm;
460 } 460 }
461 461
462 // If the counter directives change, trigger a relayout to re-calculate counter values and rebuild the counter node tree. 462 // If the counter directives change, trigger a relayout to re-calculate counter values and rebuild the counter node tree.
463 const CounterDirectiveMap* mapA = rareNonInheritedData->m_counterDirecti ves.get(); 463 const CounterDirectiveMap* mapA = rareNonInheritedData->m_counterDirecti ves.get();
464 const CounterDirectiveMap* mapB = other->rareNonInheritedData->m_counter Directives.get(); 464 const CounterDirectiveMap* mapB = other.rareNonInheritedData->m_counterD irectives.get();
465 if (!(mapA == mapB || (mapA && mapB && *mapA == *mapB))) 465 if (!(mapA == mapB || (mapA && mapB && *mapA == *mapB)))
466 return StyleDifferenceLayout; 466 return StyleDifferenceLayout;
467 467
468 // We only need do layout for opacity changes if adding or losing opacit y could trigger a change 468 // We only need do layout for opacity changes if adding or losing opacit y could trigger a change
469 // in us being a stacking context. 469 // in us being a stacking context.
470 if (hasAutoZIndex() != other->hasAutoZIndex() && rareNonInheritedData->h asOpacity() != other->rareNonInheritedData->hasOpacity()) { 470 if (hasAutoZIndex() != other.hasAutoZIndex() && rareNonInheritedData->ha sOpacity() != other.rareNonInheritedData->hasOpacity()) {
471 // FIXME: We would like to use SimplifiedLayout here, but we can't q uite do that yet. 471 // FIXME: We would like to use SimplifiedLayout here, but we can't q uite do that yet.
472 // We need to make sure SimplifiedLayout can operate correctly on Re nderInlines (we will need 472 // We need to make sure SimplifiedLayout can operate correctly on Re nderInlines (we will need
473 // to add a selfNeedsSimplifiedLayout bit in order to not get confus ed and taint every line). 473 // to add a selfNeedsSimplifiedLayout bit in order to not get confus ed and taint every line).
474 // In addition we need to solve the floating object issue when layer s come and go. Right now 474 // In addition we need to solve the floating object issue when layer s come and go. Right now
475 // a full layout is necessary to keep floating object lists sane. 475 // a full layout is necessary to keep floating object lists sane.
476 return StyleDifferenceLayout; 476 return StyleDifferenceLayout;
477 } 477 }
478 } 478 }
479 479
480 if (rareInheritedData.get() != other->rareInheritedData.get()) { 480 if (rareInheritedData.get() != other.rareInheritedData.get()) {
481 if (rareInheritedData->highlight != other->rareInheritedData->highlight 481 if (rareInheritedData->highlight != other.rareInheritedData->highlight
482 || rareInheritedData->indent != other->rareInheritedData->indent 482 || rareInheritedData->indent != other.rareInheritedData->indent
483 || rareInheritedData->m_textAlignLast != other->rareInheritedData->m _textAlignLast 483 || rareInheritedData->m_textAlignLast != other.rareInheritedData->m_ textAlignLast
484 || rareInheritedData->m_textIndentLine != other->rareInheritedData-> m_textIndentLine 484 || rareInheritedData->m_textIndentLine != other.rareInheritedData->m _textIndentLine
485 || rareInheritedData->m_effectiveZoom != other->rareInheritedData->m _effectiveZoom 485 || rareInheritedData->m_effectiveZoom != other.rareInheritedData->m_ effectiveZoom
486 || rareInheritedData->wordBreak != other->rareInheritedData->wordBre ak 486 || rareInheritedData->wordBreak != other.rareInheritedData->wordBrea k
487 || rareInheritedData->overflowWrap != other->rareInheritedData->over flowWrap 487 || rareInheritedData->overflowWrap != other.rareInheritedData->overf lowWrap
488 || rareInheritedData->lineBreak != other->rareInheritedData->lineBre ak 488 || rareInheritedData->lineBreak != other.rareInheritedData->lineBrea k
489 || rareInheritedData->textSecurity != other->rareInheritedData->text Security 489 || rareInheritedData->textSecurity != other.rareInheritedData->textS ecurity
490 || rareInheritedData->hyphens != other->rareInheritedData->hyphens 490 || rareInheritedData->hyphens != other.rareInheritedData->hyphens
491 || rareInheritedData->hyphenationLimitBefore != other->rareInherited Data->hyphenationLimitBefore 491 || rareInheritedData->hyphenationLimitBefore != other.rareInheritedD ata->hyphenationLimitBefore
492 || rareInheritedData->hyphenationLimitAfter != other->rareInheritedD ata->hyphenationLimitAfter 492 || rareInheritedData->hyphenationLimitAfter != other.rareInheritedDa ta->hyphenationLimitAfter
493 || rareInheritedData->hyphenationString != other->rareInheritedData- >hyphenationString 493 || rareInheritedData->hyphenationString != other.rareInheritedData-> hyphenationString
494 || rareInheritedData->locale != other->rareInheritedData->locale 494 || rareInheritedData->locale != other.rareInheritedData->locale
495 || rareInheritedData->m_rubyPosition != other->rareInheritedData->m_ rubyPosition 495 || rareInheritedData->m_rubyPosition != other.rareInheritedData->m_r ubyPosition
496 || rareInheritedData->textEmphasisMark != other->rareInheritedData-> textEmphasisMark 496 || rareInheritedData->textEmphasisMark != other.rareInheritedData->t extEmphasisMark
497 || rareInheritedData->textEmphasisPosition != other->rareInheritedDa ta->textEmphasisPosition 497 || rareInheritedData->textEmphasisPosition != other.rareInheritedDat a->textEmphasisPosition
498 || rareInheritedData->textEmphasisCustomMark != other->rareInherited Data->textEmphasisCustomMark 498 || rareInheritedData->textEmphasisCustomMark != other.rareInheritedD ata->textEmphasisCustomMark
499 || rareInheritedData->m_textJustify != other->rareInheritedData->m_t extJustify 499 || rareInheritedData->m_textJustify != other.rareInheritedData->m_te xtJustify
500 || rareInheritedData->m_textOrientation != other->rareInheritedData- >m_textOrientation 500 || rareInheritedData->m_textOrientation != other.rareInheritedData-> m_textOrientation
501 || rareInheritedData->m_tabSize != other->rareInheritedData->m_tabSi ze 501 || rareInheritedData->m_tabSize != other.rareInheritedData->m_tabSiz e
502 || rareInheritedData->m_lineBoxContain != other->rareInheritedData-> m_lineBoxContain 502 || rareInheritedData->m_lineBoxContain != other.rareInheritedData->m _lineBoxContain
503 || rareInheritedData->listStyleImage != other->rareInheritedData->li stStyleImage 503 || rareInheritedData->listStyleImage != other.rareInheritedData->lis tStyleImage
504 || rareInheritedData->textStrokeWidth != other->rareInheritedData->t extStrokeWidth) 504 || rareInheritedData->textStrokeWidth != other.rareInheritedData->te xtStrokeWidth)
505 return StyleDifferenceLayout; 505 return StyleDifferenceLayout;
506 506
507 if (!rareInheritedData->shadowDataEquivalent(*other->rareInheritedData.g et())) 507 if (!rareInheritedData->shadowDataEquivalent(*other.rareInheritedData.ge t()))
508 return StyleDifferenceLayout; 508 return StyleDifferenceLayout;
509 509
510 if (!QuotesData::equals(rareInheritedData->quotes.get(), other->rareInhe ritedData->quotes.get())) 510 if (!QuotesData::equals(rareInheritedData->quotes.get(), other.rareInher itedData->quotes.get()))
511 return StyleDifferenceLayout; 511 return StyleDifferenceLayout;
512 } 512 }
513 513
514 if (visual->m_textAutosizingMultiplier != other->visual->m_textAutosizingMul tiplier) 514 if (visual->m_textAutosizingMultiplier != other.visual->m_textAutosizingMult iplier)
515 return StyleDifferenceLayout; 515 return StyleDifferenceLayout;
516 516
517 if (inherited.get() != other->inherited.get()) { 517 if (inherited.get() != other.inherited.get()) {
518 if (inherited->line_height != other->inherited->line_height 518 if (inherited->line_height != other.inherited->line_height
519 || inherited->font != other->inherited->font 519 || inherited->font != other.inherited->font
520 || inherited->horizontal_border_spacing != other->inherited->horizontal_ border_spacing 520 || inherited->horizontal_border_spacing != other.inherited->horizontal_b order_spacing
521 || inherited->vertical_border_spacing != other->inherited->vertical_bord er_spacing) 521 || inherited->vertical_border_spacing != other.inherited->vertical_borde r_spacing)
522 return StyleDifferenceLayout; 522 return StyleDifferenceLayout;
523 } 523 }
524 524
525 if (inherited_flags._box_direction != other->inherited_flags._box_direction 525 if (inherited_flags._box_direction != other.inherited_flags._box_direction
526 || inherited_flags.m_rtlOrdering != other->inherited_flags.m_rtlOrdering 526 || inherited_flags.m_rtlOrdering != other.inherited_flags.m_rtlOrdering
527 || inherited_flags._text_align != other->inherited_flags._text_align 527 || inherited_flags._text_align != other.inherited_flags._text_align
528 || inherited_flags._text_transform != other->inherited_flags._text_trans form 528 || inherited_flags._text_transform != other.inherited_flags._text_transf orm
529 || inherited_flags._direction != other->inherited_flags._direction 529 || inherited_flags._direction != other.inherited_flags._direction
530 || inherited_flags._white_space != other->inherited_flags._white_space 530 || inherited_flags._white_space != other.inherited_flags._white_space
531 || inherited_flags.m_writingMode != other->inherited_flags.m_writingMode ) 531 || inherited_flags.m_writingMode != other.inherited_flags.m_writingMode)
532 return StyleDifferenceLayout; 532 return StyleDifferenceLayout;
533 533
534 if (noninherited_flags._overflowX != other->noninherited_flags._overflowX 534 if (noninherited_flags._overflowX != other.noninherited_flags._overflowX
535 || noninherited_flags._overflowY != other->noninherited_flags._overflowY 535 || noninherited_flags._overflowY != other.noninherited_flags._overflowY
536 || noninherited_flags._clear != other->noninherited_flags._clear 536 || noninherited_flags._clear != other.noninherited_flags._clear
537 || noninherited_flags._unicodeBidi != other->noninherited_flags._unicode Bidi 537 || noninherited_flags._unicodeBidi != other.noninherited_flags._unicodeB idi
538 || noninherited_flags._position != other->noninherited_flags._position 538 || noninherited_flags._position != other.noninherited_flags._position
539 || noninherited_flags._floating != other->noninherited_flags._floating 539 || noninherited_flags._floating != other.noninherited_flags._floating
540 || noninherited_flags._originalDisplay != other->noninherited_flags._ori ginalDisplay 540 || noninherited_flags._originalDisplay != other.noninherited_flags._orig inalDisplay
541 || noninherited_flags._vertical_align != other->noninherited_flags._vert ical_align) 541 || noninherited_flags._vertical_align != other.noninherited_flags._verti cal_align)
542 return StyleDifferenceLayout; 542 return StyleDifferenceLayout;
543 543
544 if (noninherited_flags._effectiveDisplay >= FIRST_TABLE_DISPLAY && noninheri ted_flags._effectiveDisplay <= LAST_TABLE_DISPLAY) { 544 if (noninherited_flags._effectiveDisplay >= FIRST_TABLE_DISPLAY && noninheri ted_flags._effectiveDisplay <= LAST_TABLE_DISPLAY) {
545 if (inherited_flags._border_collapse != other->inherited_flags._border_c ollapse 545 if (inherited_flags._border_collapse != other.inherited_flags._border_co llapse
546 || inherited_flags._empty_cells != other->inherited_flags._empty_cel ls 546 || inherited_flags._empty_cells != other.inherited_flags._empty_cell s
547 || inherited_flags._caption_side != other->inherited_flags._caption_ side 547 || inherited_flags._caption_side != other.inherited_flags._caption_s ide
548 || noninherited_flags._table_layout != other->noninherited_flags._ta ble_layout) 548 || noninherited_flags._table_layout != other.noninherited_flags._tab le_layout)
549 return StyleDifferenceLayout; 549 return StyleDifferenceLayout;
550 550
551 // In the collapsing border model, 'hidden' suppresses other borders, wh ile 'none' 551 // In the collapsing border model, 'hidden' suppresses other borders, wh ile 'none'
552 // does not, so these style differences can be width differences. 552 // does not, so these style differences can be width differences.
553 if (inherited_flags._border_collapse 553 if (inherited_flags._border_collapse
554 && ((borderTopStyle() == BHIDDEN && other->borderTopStyle() == BNONE ) 554 && ((borderTopStyle() == BHIDDEN && other.borderTopStyle() == BNONE)
555 || (borderTopStyle() == BNONE && other->borderTopStyle() == BHID DEN) 555 || (borderTopStyle() == BNONE && other.borderTopStyle() == BHIDD EN)
556 || (borderBottomStyle() == BHIDDEN && other->borderBottomStyle() == BNONE) 556 || (borderBottomStyle() == BHIDDEN && other.borderBottomStyle() == BNONE)
557 || (borderBottomStyle() == BNONE && other->borderBottomStyle() = = BHIDDEN) 557 || (borderBottomStyle() == BNONE && other.borderBottomStyle() == BHIDDEN)
558 || (borderLeftStyle() == BHIDDEN && other->borderLeftStyle() == BNONE) 558 || (borderLeftStyle() == BHIDDEN && other.borderLeftStyle() == B NONE)
559 || (borderLeftStyle() == BNONE && other->borderLeftStyle() == BH IDDEN) 559 || (borderLeftStyle() == BNONE && other.borderLeftStyle() == BHI DDEN)
560 || (borderRightStyle() == BHIDDEN && other->borderRightStyle() = = BNONE) 560 || (borderRightStyle() == BHIDDEN && other.borderRightStyle() == BNONE)
561 || (borderRightStyle() == BNONE && other->borderRightStyle() == BHIDDEN))) 561 || (borderRightStyle() == BNONE && other.borderRightStyle() == B HIDDEN)))
562 return StyleDifferenceLayout; 562 return StyleDifferenceLayout;
563 } else if (noninherited_flags._effectiveDisplay == LIST_ITEM) { 563 } else if (noninherited_flags._effectiveDisplay == LIST_ITEM) {
564 if (inherited_flags._list_style_type != other->inherited_flags._list_sty le_type 564 if (inherited_flags._list_style_type != other.inherited_flags._list_styl e_type
565 || inherited_flags._list_style_position != other->inherited_flags._l ist_style_position) 565 || inherited_flags._list_style_position != other.inherited_flags._li st_style_position)
566 return StyleDifferenceLayout; 566 return StyleDifferenceLayout;
567 } 567 }
568 568
569 if ((visibility() == COLLAPSE) != (other->visibility() == COLLAPSE)) 569 if ((visibility() == COLLAPSE) != (other.visibility() == COLLAPSE))
570 return StyleDifferenceLayout; 570 return StyleDifferenceLayout;
571 571
572 // SVGRenderStyle::diff() might have returned StyleDifferenceRepaint, eg. if fill changes. 572 // SVGRenderStyle::diff() might have returned StyleDifferenceRepaint, eg. if fill changes.
573 // If eg. the font-size changed at the same time, we're not allowed to retur n StyleDifferenceRepaint, 573 // If eg. the font-size changed at the same time, we're not allowed to retur n StyleDifferenceRepaint,
574 // but have to return StyleDifferenceLayout, that's why this if branch come s after all branches 574 // but have to return StyleDifferenceLayout, that's why this if branch come s after all branches
575 // that are relevant for SVG and might return StyleDifferenceLayout. 575 // that are relevant for SVG and might return StyleDifferenceLayout.
576 if (svgChange != StyleDifferenceEqual) 576 if (svgChange != StyleDifferenceEqual)
577 return svgChange; 577 return svgChange;
578 578
579 // NOTE: This block must be last in this function for the StyleDifferenceLay outPositionedMovementOnly 579 // NOTE: This block must be last in this function for the StyleDifferenceLay outPositionedMovementOnly
580 // optimization to work properly. 580 // optimization to work properly.
581 if (position() != StaticPosition && surround->offset != other->surround->off set) { 581 if (position() != StaticPosition && surround->offset != other.surround->offs et) {
582 // Optimize for the case where a positioned layer is moving but not chan ging size. 582 // Optimize for the case where a positioned layer is moving but not chan ging size.
583 if ((position() == AbsolutePosition || position() == FixedPosition) 583 if ((position() == AbsolutePosition || position() == FixedPosition)
584 && positionedObjectMovedOnly(surround->offset, other->surround->offs et, m_box->width()) 584 && positionedObjectMovedOnly(surround->offset, other.surround->offse t, m_box->width())
585 && repaintOnlyDiff(other, changedContextSensitiveProperties) == Styl eDifferenceEqual) 585 && repaintOnlyDiff(other, changedContextSensitiveProperties) == Styl eDifferenceEqual)
586 return StyleDifferenceLayoutPositionedMovementOnly; 586 return StyleDifferenceLayoutPositionedMovementOnly;
587 // FIXME: We would like to use SimplifiedLayout for relative positioning , but we can't quite do that yet. 587 // FIXME: We would like to use SimplifiedLayout for relative positioning , but we can't quite do that yet.
588 // We need to make sure SimplifiedLayout can operate correctly on Render Inlines (we will need 588 // We need to make sure SimplifiedLayout can operate correctly on Render Inlines (we will need
589 // to add a selfNeedsSimplifiedLayout bit in order to not get confused a nd taint every line). 589 // to add a selfNeedsSimplifiedLayout bit in order to not get confused a nd taint every line).
590 return StyleDifferenceLayout; 590 return StyleDifferenceLayout;
591 } 591 }
592 592
593 return repaintOnlyDiff(other, changedContextSensitiveProperties); 593 return repaintOnlyDiff(other, changedContextSensitiveProperties);
594 } 594 }
595 595
596 StyleDifference RenderStyle::repaintOnlyDiff(const RenderStyle* other, unsigned& changedContextSensitiveProperties) const 596 StyleDifference RenderStyle::repaintOnlyDiff(const RenderStyle& other, unsigned& changedContextSensitiveProperties) const
597 { 597 {
598 if (position() != StaticPosition && (m_box->zIndex() != other->m_box->zIndex () || m_box->hasAutoZIndex() != other->m_box->hasAutoZIndex() 598 if (position() != StaticPosition && (m_box->zIndex() != other.m_box->zIndex( ) || m_box->hasAutoZIndex() != other.m_box->hasAutoZIndex()
599 || visual->clip != other->visual->clip || visual->hasClip != other->visu al->hasClip)) 599 || visual->clip != other.visual->clip || visual->hasClip != other.visual ->hasClip))
600 return StyleDifferenceRepaintLayer; 600 return StyleDifferenceRepaintLayer;
601 601
602 if (RuntimeEnabledFeatures::cssCompositingEnabled() && (rareNonInheritedData ->m_effectiveBlendMode != other->rareNonInheritedData->m_effectiveBlendMode 602 if (RuntimeEnabledFeatures::cssCompositingEnabled() && (rareNonInheritedData ->m_effectiveBlendMode != other.rareNonInheritedData->m_effectiveBlendMode
603 || rareNonInheritedData->m_isolation != other->rareNonInheritedData->m_i solation)) 603 || rareNonInheritedData->m_isolation != other.rareNonInheritedData->m_is olation))
604 return StyleDifferenceRepaintLayer; 604 return StyleDifferenceRepaintLayer;
605 605
606 if (rareNonInheritedData->opacity != other->rareNonInheritedData->opacity) { 606 if (rareNonInheritedData->opacity != other.rareNonInheritedData->opacity) {
607 // Don't return early here; instead take note of the type of change, 607 // Don't return early here; instead take note of the type of change,
608 // and deal with it when looking at compositing. 608 // and deal with it when looking at compositing.
609 changedContextSensitiveProperties |= ContextSensitivePropertyOpacity; 609 changedContextSensitiveProperties |= ContextSensitivePropertyOpacity;
610 } 610 }
611 611
612 if (rareNonInheritedData->m_filter.get() != other->rareNonInheritedData->m_f ilter.get() 612 if (rareNonInheritedData->m_filter.get() != other.rareNonInheritedData->m_fi lter.get()
613 && *rareNonInheritedData->m_filter.get() != *other->rareNonInheritedData ->m_filter.get()) { 613 && *rareNonInheritedData->m_filter.get() != *other.rareNonInheritedData- >m_filter.get()) {
614 // Don't return early here; instead take note of the type of change, 614 // Don't return early here; instead take note of the type of change,
615 // and deal with it when looking at compositing. 615 // and deal with it when looking at compositing.
616 changedContextSensitiveProperties |= ContextSensitivePropertyFilter; 616 changedContextSensitiveProperties |= ContextSensitivePropertyFilter;
617 } 617 }
618 618
619 if (rareNonInheritedData->m_mask != other->rareNonInheritedData->m_mask 619 if (rareNonInheritedData->m_mask != other.rareNonInheritedData->m_mask
620 || rareNonInheritedData->m_maskBoxImage != other->rareNonInheritedData-> m_maskBoxImage) 620 || rareNonInheritedData->m_maskBoxImage != other.rareNonInheritedData->m _maskBoxImage)
621 return StyleDifferenceRepaintLayer; 621 return StyleDifferenceRepaintLayer;
622 622
623 if (inherited_flags._visibility != other->inherited_flags._visibility 623 if (inherited_flags._visibility != other.inherited_flags._visibility
624 || inherited_flags.m_printColorAdjust != other->inherited_flags.m_printC olorAdjust 624 || inherited_flags.m_printColorAdjust != other.inherited_flags.m_printCo lorAdjust
625 || inherited_flags._insideLink != other->inherited_flags._insideLink 625 || inherited_flags._insideLink != other.inherited_flags._insideLink
626 || surround->border != other->surround->border 626 || surround->border != other.surround->border
627 || *m_background.get() != *other->m_background.get() 627 || *m_background.get() != *other.m_background.get()
628 || rareInheritedData->userModify != other->rareInheritedData->userModify 628 || rareInheritedData->userModify != other.rareInheritedData->userModify
629 || rareInheritedData->userSelect != other->rareInheritedData->userSelect 629 || rareInheritedData->userSelect != other.rareInheritedData->userSelect
630 || rareNonInheritedData->userDrag != other->rareNonInheritedData->userDr ag 630 || rareNonInheritedData->userDrag != other.rareNonInheritedData->userDra g
631 || rareNonInheritedData->m_borderFit != other->rareNonInheritedData->m_b orderFit 631 || rareNonInheritedData->m_borderFit != other.rareNonInheritedData->m_bo rderFit
632 || rareNonInheritedData->m_objectFit != other->rareNonInheritedData->m_o bjectFit 632 || rareNonInheritedData->m_objectFit != other.rareNonInheritedData->m_ob jectFit
633 || rareNonInheritedData->m_objectPosition != other->rareNonInheritedData ->m_objectPosition 633 || rareNonInheritedData->m_objectPosition != other.rareNonInheritedData- >m_objectPosition
634 || rareInheritedData->m_imageRendering != other->rareInheritedData->m_im ageRendering) 634 || rareInheritedData->m_imageRendering != other.rareInheritedData->m_ima geRendering)
635 return StyleDifferenceRepaint; 635 return StyleDifferenceRepaint;
636 636
637 // FIXME: The current spec is being reworked to remove dependencies betw een exclusions and affected 637 // FIXME: The current spec is being reworked to remove dependencies betw een exclusions and affected
638 // content. There's a proposal to use floats instead. In that case, wrap -shape should actually relayout 638 // content. There's a proposal to use floats instead. In that case, wrap -shape should actually relayout
639 // the parent container. For sure, I will have to revisit this code, but for now I've added this in order 639 // the parent container. For sure, I will have to revisit this code, but for now I've added this in order
640 // to avoid having diff() == StyleDifferenceEqual where wrap-shapes actu ally differ. 640 // to avoid having diff() == StyleDifferenceEqual where wrap-shapes actu ally differ.
641 // Tracking bug: https://bugs.webkit.org/show_bug.cgi?id=62991 641 // Tracking bug: https://bugs.webkit.org/show_bug.cgi?id=62991
642 if (rareNonInheritedData->m_shapeOutside != other->rareNonInheritedData- >m_shapeOutside) 642 if (rareNonInheritedData->m_shapeOutside != other.rareNonInheritedData-> m_shapeOutside)
643 return StyleDifferenceRepaint; 643 return StyleDifferenceRepaint;
644 644
645 if (rareNonInheritedData->m_clipPath != other->rareNonInheritedData->m_c lipPath) 645 if (rareNonInheritedData->m_clipPath != other.rareNonInheritedData->m_cl ipPath)
646 return StyleDifferenceRepaint; 646 return StyleDifferenceRepaint;
647 647
648 if (rareNonInheritedData.get() != other->rareNonInheritedData.get()) { 648 if (rareNonInheritedData.get() != other.rareNonInheritedData.get()) {
649 if (rareNonInheritedData->m_transformStyle3D != other->rareNonInheritedD ata->m_transformStyle3D 649 if (rareNonInheritedData->m_transformStyle3D != other.rareNonInheritedDa ta->m_transformStyle3D
650 || rareNonInheritedData->m_backfaceVisibility != other->rareNonInher itedData->m_backfaceVisibility 650 || rareNonInheritedData->m_backfaceVisibility != other.rareNonInheri tedData->m_backfaceVisibility
651 || rareNonInheritedData->m_perspective != other->rareNonInheritedDat a->m_perspective 651 || rareNonInheritedData->m_perspective != other.rareNonInheritedData ->m_perspective
652 || rareNonInheritedData->m_perspectiveOriginX != other->rareNonInher itedData->m_perspectiveOriginX 652 || rareNonInheritedData->m_perspectiveOriginX != other.rareNonInheri tedData->m_perspectiveOriginX
653 || rareNonInheritedData->m_perspectiveOriginY != other->rareNonInher itedData->m_perspectiveOriginY 653 || rareNonInheritedData->m_perspectiveOriginY != other.rareNonInheri tedData->m_perspectiveOriginY
654 || hasWillChangeCompositingHint() != other->hasWillChangeCompositing Hint() 654 || hasWillChangeCompositingHint() != other.hasWillChangeCompositingH int()
655 || hasWillChangeGpuRasterizationHint() != other->hasWillChangeGpuRas terizationHint()) 655 || hasWillChangeGpuRasterizationHint() != other.hasWillChangeGpuRast erizationHint())
656 return StyleDifferenceRecompositeLayer; 656 return StyleDifferenceRecompositeLayer;
657 } 657 }
658 658
659 if (inherited->color != other->inherited->color 659 if (inherited->color != other.inherited->color
660 || inherited_flags._text_decorations != other->inherited_flags._text_dec orations 660 || inherited_flags._text_decorations != other.inherited_flags._text_deco rations
661 || visual->textDecoration != other->visual->textDecoration 661 || visual->textDecoration != other.visual->textDecoration
662 || rareNonInheritedData->m_textDecorationStyle != other->rareNonInherite dData->m_textDecorationStyle 662 || rareNonInheritedData->m_textDecorationStyle != other.rareNonInherited Data->m_textDecorationStyle
663 || rareNonInheritedData->m_textDecorationColor != other->rareNonInherite dData->m_textDecorationColor 663 || rareNonInheritedData->m_textDecorationColor != other.rareNonInherited Data->m_textDecorationColor
664 || rareInheritedData->textFillColor() != other->rareInheritedData->textF illColor() 664 || rareInheritedData->textFillColor() != other.rareInheritedData->textFi llColor()
665 || rareInheritedData->textStrokeColor() != other->rareInheritedData->tex tStrokeColor() 665 || rareInheritedData->textStrokeColor() != other.rareInheritedData->text StrokeColor()
666 || rareInheritedData->textEmphasisColor() != other->rareInheritedData->t extEmphasisColor() 666 || rareInheritedData->textEmphasisColor() != other.rareInheritedData->te xtEmphasisColor()
667 || rareInheritedData->textEmphasisFill != other->rareInheritedData->text EmphasisFill) 667 || rareInheritedData->textEmphasisFill != other.rareInheritedData->textE mphasisFill)
668 return StyleDifferenceRepaintIfTextOrColorChange; 668 return StyleDifferenceRepaintIfTextOrColorChange;
669 669
670 // Cursors are not checked, since they will be set appropriately in response to mouse events, 670 // Cursors are not checked, since they will be set appropriately in response to mouse events,
671 // so they don't need to cause any repaint or layout. 671 // so they don't need to cause any repaint or layout.
672 672
673 // Animations don't need to be checked either. We always set the new style on the RenderObject, so we will get a chance to fire off 673 // Animations don't need to be checked either. We always set the new style on the RenderObject, so we will get a chance to fire off
674 // the resulting transition properly. 674 // the resulting transition properly.
675 return StyleDifferenceEqual; 675 return StyleDifferenceEqual;
676 } 676 }
677 677
(...skipping 976 matching lines...) Expand 10 before | Expand all | Expand 10 after
1654 // right 1654 // right
1655 radiiSum = radii.topRight().height() + radii.bottomRight().height(); 1655 radiiSum = radii.topRight().height() + radii.bottomRight().height();
1656 if (radiiSum > rect.height()) 1656 if (radiiSum > rect.height())
1657 factor = std::min(rect.height() / radiiSum, factor); 1657 factor = std::min(rect.height() / radiiSum, factor);
1658 1658
1659 ASSERT(factor <= 1); 1659 ASSERT(factor <= 1);
1660 return factor; 1660 return factor;
1661 } 1661 }
1662 1662
1663 } // namespace WebCore 1663 } // namespace WebCore
OLDNEW
« Source/core/rendering/RenderBox.cpp ('K') | « Source/core/rendering/style/RenderStyle.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698