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

Side by Side Diff: Source/core/style/BorderImageLength.h

Issue 1169623002: Fix visual overflow for LayoutBoxes with numeric border image outsets (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013, Opera Software ASA. All rights reserved. 2 * Copyright (c) 2013, Opera Software ASA. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 62
63 double number() const { ASSERT(isNumber()); return m_number; } 63 double number() const { ASSERT(isNumber()); return m_number; }
64 64
65 bool operator==(const BorderImageLength& other) const 65 bool operator==(const BorderImageLength& other) const
66 { 66 {
67 return m_type == other.m_type && m_length == other.m_length && m_number == other.m_number; 67 return m_type == other.m_type && m_length == other.m_length && m_number == other.m_number;
68 } 68 }
69 69
70 bool isZero() const 70 bool isZero() const
71 { 71 {
72 return (isLength() && m_length.isZero()) || (isNumber() && m_number); 72 if (isLength())
73 return m_length.isZero();
74
75 ASSERT(isNumber());
76 return !m_number;
73 } 77 }
74 78
75 private: 79 private:
76 // Ideally we would put the 2 following fields in a union, but Length has a constructor, 80 // Ideally we would put the 2 following fields in a union, but Length has a constructor,
77 // a destructor and a copy assignment which isn't allowed. 81 // a destructor and a copy assignment which isn't allowed.
78 Length m_length; 82 Length m_length;
79 double m_number; 83 double m_number;
80 enum { 84 enum {
81 LengthType, 85 LengthType,
82 NumberType 86 NumberType
83 } m_type; 87 } m_type;
84 }; 88 };
85 89
86 } // namespace blink 90 } // namespace blink
87 91
88 #endif // BorderImageLength_h 92 #endif // BorderImageLength_h
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698