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

Side by Side Diff: third_party/WebKit/Source/core/style/ComputedStyle.cpp

Issue 2824973002: Split StyleSurroundData::margin into four individual Lengths. (Closed)
Patch Set: Created 3 years, 8 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
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 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
4 * reserved. 4 * reserved.
5 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. 5 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 520
521 if ((!diff.NeedsFullLayout() || !diff.NeedsFullPaintInvalidation()) && 521 if ((!diff.NeedsFullLayout() || !diff.NeedsFullPaintInvalidation()) &&
522 DiffNeedsFullLayoutAndPaintInvalidation(other)) { 522 DiffNeedsFullLayoutAndPaintInvalidation(other)) {
523 diff.SetNeedsFullLayout(); 523 diff.SetNeedsFullLayout();
524 diff.SetNeedsPaintInvalidationObject(); 524 diff.SetNeedsPaintInvalidationObject();
525 } 525 }
526 526
527 if (!diff.NeedsFullLayout() && DiffNeedsFullLayout(other)) 527 if (!diff.NeedsFullLayout() && DiffNeedsFullLayout(other))
528 diff.SetNeedsFullLayout(); 528 diff.SetNeedsFullLayout();
529 529
530 if (!diff.NeedsFullLayout() && Margin() != other.Margin()) { 530 if (!diff.NeedsFullLayout() && !MarginEqual(other)) {
531 // Relative-positioned elements collapse their margins so need a full 531 // Relative-positioned elements collapse their margins so need a full
532 // layout. 532 // layout.
533 if (HasOutOfFlowPosition()) 533 if (HasOutOfFlowPosition())
534 diff.SetNeedsPositionedMovementLayout(); 534 diff.SetNeedsPositionedMovementLayout();
535 else 535 else
536 diff.SetNeedsFullLayout(); 536 diff.SetNeedsFullLayout();
537 } 537 }
538 538
539 if (!diff.NeedsFullLayout() && GetPosition() != EPosition::kStatic && 539 if (!diff.NeedsFullLayout() && GetPosition() != EPosition::kStatic &&
540 !OffsetEqual(other)) { 540 !OffsetEqual(other)) {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 if (box_->Width() != other.box_->Width() || 582 if (box_->Width() != other.box_->Width() ||
583 box_->MinWidth() != other.box_->MinWidth() || 583 box_->MinWidth() != other.box_->MinWidth() ||
584 box_->MaxWidth() != other.box_->MaxWidth() || 584 box_->MaxWidth() != other.box_->MaxWidth() ||
585 box_->Height() != other.box_->Height() || 585 box_->Height() != other.box_->Height() ||
586 box_->MinHeight() != other.box_->MinHeight() || 586 box_->MinHeight() != other.box_->MinHeight() ||
587 box_->MaxHeight() != other.box_->MaxHeight()) 587 box_->MaxHeight() != other.box_->MaxHeight())
588 return true; 588 return true;
589 } 589 }
590 590
591 if (surround_.Get() != other.surround_.Get()) { 591 if (surround_.Get() != other.surround_.Get()) {
592 if (Margin() != other.Margin() || !OffsetEqual(other) || 592 if (!MarginEqual(other) || !OffsetEqual(other) ||
593 Padding() != other.Padding()) 593 Padding() != other.Padding())
594 return true; 594 return true;
595 } 595 }
596 596
597 if (diff.TransformChanged()) 597 if (diff.TransformChanged())
598 return true; 598 return true;
599 599
600 return false; 600 return false;
601 } 601 }
602 602
(...skipping 1898 matching lines...) Expand 10 before | Expand all | Expand 10 after
2501 if (value < 0) 2501 if (value < 0)
2502 fvalue -= 0.5f; 2502 fvalue -= 0.5f;
2503 else 2503 else
2504 fvalue += 0.5f; 2504 fvalue += 0.5f;
2505 } 2505 }
2506 2506
2507 return RoundForImpreciseConversion<int>(fvalue / zoom_factor); 2507 return RoundForImpreciseConversion<int>(fvalue / zoom_factor);
2508 } 2508 }
2509 2509
2510 } // namespace blink 2510 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698