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

Side by Side Diff: third_party/WebKit/Source/platform/LayoutUnit.h

Issue 1860273002: Fix scrollIntoViewIfNeeded when scroll box has no height or width. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed broken composition test Created 4 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) 2012, Google Inc. All rights reserved. 2 * Copyright (c) 2012, Google Inc. 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 const int intMinForLayoutUnit = INT_MIN / kFixedPointDenominator; 55 const int intMinForLayoutUnit = INT_MIN / kFixedPointDenominator;
56 56
57 // TODO(thakis): Remove these two lines once http://llvm.org/PR26504 is resolved 57 // TODO(thakis): Remove these two lines once http://llvm.org/PR26504 is resolved
58 class LayoutUnit; 58 class LayoutUnit;
59 inline bool operator<(const LayoutUnit&, const LayoutUnit&); 59 inline bool operator<(const LayoutUnit&, const LayoutUnit&);
60 60
61 class LayoutUnit { 61 class LayoutUnit {
62 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); 62 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
63 public: 63 public:
64 LayoutUnit() : m_value(0) { } 64 LayoutUnit() : m_value(0) { }
65 // TODO(leviw): All of the below constructors should be explicit. crbug.com/ 581254
66 explicit LayoutUnit(int value) { setValue(value); } 65 explicit LayoutUnit(int value) { setValue(value); }
67 explicit LayoutUnit(unsigned short value) { setValue(value); } 66 explicit LayoutUnit(unsigned short value) { setValue(value); }
68 explicit LayoutUnit(unsigned value) { setValue(value); } 67 explicit LayoutUnit(unsigned value) { setValue(value); }
69 explicit LayoutUnit(unsigned long value) { m_value = clampTo<int>(value * kF ixedPointDenominator); } 68 explicit LayoutUnit(unsigned long value) { m_value = clampTo<int>(value * kF ixedPointDenominator); }
70 explicit LayoutUnit(unsigned long long value) { m_value = clampTo<int>(value * kFixedPointDenominator); } 69 explicit LayoutUnit(unsigned long long value) { m_value = clampTo<int>(value * kFixedPointDenominator); }
71 explicit LayoutUnit(float value) { m_value = clampTo<int>(value * kFixedPoin tDenominator); } 70 explicit LayoutUnit(float value) { m_value = clampTo<int>(value * kFixedPoin tDenominator); }
72 explicit LayoutUnit(double value) { m_value = clampTo<int>(value * kFixedPoi ntDenominator); } 71 explicit LayoutUnit(double value) { m_value = clampTo<int>(value * kFixedPoi ntDenominator); }
73 72
74 static LayoutUnit fromFloatCeil(float value) 73 static LayoutUnit fromFloatCeil(float value)
75 { 74 {
(...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after
808 } 807 }
809 808
810 inline std::ostream& operator<<(std::ostream& stream, const LayoutUnit& value) 809 inline std::ostream& operator<<(std::ostream& stream, const LayoutUnit& value)
811 { 810 {
812 return stream << value.toDouble(); 811 return stream << value.toDouble();
813 } 812 }
814 813
815 } // namespace blink 814 } // namespace blink
816 815
817 #endif // LayoutUnit_h 816 #endif // LayoutUnit_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/ScrollAlignment.cpp ('k') | third_party/WebKit/Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698