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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutTableCell.cpp

Issue 2080623002: Revert "Remove OwnPtr from Blink." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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) 1997 Martin Jones (mjones@kde.org) 2 * Copyright (C) 1997 Martin Jones (mjones@kde.org)
3 * (C) 1997 Torben Weis (weis@kde.org) 3 * (C) 1997 Torben Weis (weis@kde.org)
4 * (C) 1998 Waldo Bastian (bastian@kde.org) 4 * (C) 1998 Waldo Bastian (bastian@kde.org)
5 * (C) 1999 Lars Knoll (knoll@kde.org) 5 * (C) 1999 Lars Knoll (knoll@kde.org)
6 * (C) 1999 Antti Koivisto (koivisto@kde.org) 6 * (C) 1999 Antti Koivisto (koivisto@kde.org)
7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 16 matching lines...) Expand all
27 #include "core/HTMLNames.h" 27 #include "core/HTMLNames.h"
28 #include "core/css/StylePropertySet.h" 28 #include "core/css/StylePropertySet.h"
29 #include "core/html/HTMLTableCellElement.h" 29 #include "core/html/HTMLTableCellElement.h"
30 #include "core/layout/LayoutAnalyzer.h" 30 #include "core/layout/LayoutAnalyzer.h"
31 #include "core/layout/LayoutTableCol.h" 31 #include "core/layout/LayoutTableCol.h"
32 #include "core/layout/SubtreeLayoutScope.h" 32 #include "core/layout/SubtreeLayoutScope.h"
33 #include "core/paint/TableCellPainter.h" 33 #include "core/paint/TableCellPainter.h"
34 #include "core/style/CollapsedBorderValue.h" 34 #include "core/style/CollapsedBorderValue.h"
35 #include "platform/geometry/FloatQuad.h" 35 #include "platform/geometry/FloatQuad.h"
36 #include "platform/geometry/TransformState.h" 36 #include "platform/geometry/TransformState.h"
37 #include "wtf/PtrUtil.h"
38 37
39 namespace blink { 38 namespace blink {
40 39
41 using namespace HTMLNames; 40 using namespace HTMLNames;
42 41
43 struct SameSizeAsLayoutTableCell : public LayoutBlockFlow { 42 struct SameSizeAsLayoutTableCell : public LayoutBlockFlow {
44 unsigned bitfields; 43 unsigned bitfields;
45 int paddings[2]; 44 int paddings[2];
46 void* pointer; 45 void* pointer;
47 }; 46 };
(...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after
916 computeCollapsedBeforeBorder(), 915 computeCollapsedBeforeBorder(),
917 computeCollapsedAfterBorder() 916 computeCollapsedAfterBorder()
918 }; 917 };
919 918
920 bool changed = false; 919 bool changed = false;
921 if (!newValues.startBorder.isVisible() && !newValues.endBorder.isVisible() & & !newValues.beforeBorder.isVisible() && !newValues.afterBorder.isVisible()) { 920 if (!newValues.startBorder.isVisible() && !newValues.endBorder.isVisible() & & !newValues.beforeBorder.isVisible() && !newValues.afterBorder.isVisible()) {
922 changed = !!m_collapsedBorderValues; 921 changed = !!m_collapsedBorderValues;
923 m_collapsedBorderValues = nullptr; 922 m_collapsedBorderValues = nullptr;
924 } else if (!m_collapsedBorderValues) { 923 } else if (!m_collapsedBorderValues) {
925 changed = true; 924 changed = true;
926 m_collapsedBorderValues = wrapUnique(new CollapsedBorderValues(newValues )); 925 m_collapsedBorderValues = adoptPtr(new CollapsedBorderValues(newValues)) ;
927 } else { 926 } else {
928 // We check visuallyEquals so that the table cell is invalidated only if a changed 927 // We check visuallyEquals so that the table cell is invalidated only if a changed
929 // collapsed border is visible in the first place. 928 // collapsed border is visible in the first place.
930 changed = !m_collapsedBorderValues->startBorder.visuallyEquals(newValues .startBorder) 929 changed = !m_collapsedBorderValues->startBorder.visuallyEquals(newValues .startBorder)
931 || !m_collapsedBorderValues->endBorder.visuallyEquals(newValues.endB order) 930 || !m_collapsedBorderValues->endBorder.visuallyEquals(newValues.endB order)
932 || !m_collapsedBorderValues->beforeBorder.visuallyEquals(newValues.b eforeBorder) 931 || !m_collapsedBorderValues->beforeBorder.visuallyEquals(newValues.b eforeBorder)
933 || !m_collapsedBorderValues->afterBorder.visuallyEquals(newValues.af terBorder); 932 || !m_collapsedBorderValues->afterBorder.visuallyEquals(newValues.af terBorder);
934 if (changed) 933 if (changed)
935 *m_collapsedBorderValues = newValues; 934 *m_collapsedBorderValues = newValues;
936 } 935 }
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
1010 bool LayoutTableCell::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localR ect) const 1009 bool LayoutTableCell::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localR ect) const
1011 { 1010 {
1012 // If this object has layer, the area of collapsed borders should be transpa rent 1011 // If this object has layer, the area of collapsed borders should be transpa rent
1013 // to expose the collapsed borders painted on the underlying layer. 1012 // to expose the collapsed borders painted on the underlying layer.
1014 if (hasLayer() && table()->collapseBorders()) 1013 if (hasLayer() && table()->collapseBorders())
1015 return false; 1014 return false;
1016 return LayoutBlockFlow::backgroundIsKnownToBeOpaqueInRect(localRect); 1015 return LayoutBlockFlow::backgroundIsKnownToBeOpaqueInRect(localRect);
1017 } 1016 }
1018 1017
1019 } // namespace blink 1018 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTableCell.h ('k') | third_party/WebKit/Source/core/layout/LayoutTestHelper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698