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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutTextControl.h

Issue 1365853003: LayoutBox::scrollRectToVisible doesn't respect overflow:hidden property. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Handle case when overflow-x:hidden and y:scroll Created 5 years, 2 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) 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
3 * (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 3 * (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const final; 78 void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const final;
79 void computePreferredLogicalWidths() final; 79 void computePreferredLogicalWidths() final;
80 void removeLeftoverAnonymousBlock(LayoutBlock*) final { } 80 void removeLeftoverAnonymousBlock(LayoutBlock*) final { }
81 bool avoidsFloats() const final { return true; } 81 bool avoidsFloats() const final { return true; }
82 82
83 void addChild(LayoutObject* newChild, LayoutObject* beforeChild = nullptr) f inal; 83 void addChild(LayoutObject* newChild, LayoutObject* beforeChild = nullptr) f inal;
84 84
85 void addOutlineRects(Vector<LayoutRect>&, const LayoutPoint& additionalOffse t, IncludeBlockVisualOverflowOrNot) const final; 85 void addOutlineRects(Vector<LayoutRect>&, const LayoutPoint& additionalOffse t, IncludeBlockVisualOverflowOrNot) const final;
86 86
87 bool canBeProgramaticallyScrolled() const final { return true; } 87 bool canBeProgramaticallyScrolled() const final { return true; }
88 void scrollRectToVisible(const LayoutRect&, const ScrollAlignment& alignX, c onst ScrollAlignment& alignY, bool programmaticScroll) override;
88 }; 89 };
89 90
90 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutTextControl, isTextControl()); 91 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutTextControl, isTextControl());
91 92
92 // LayoutObject for our inner container, for <search> and others. 93 // LayoutObject for our inner container, for <search> and others.
93 // We can't use LayoutFlexibleBox directly, because flexboxes have a different 94 // We can't use LayoutFlexibleBox directly, because flexboxes have a different
94 // baseline definition, and then inputs of different types wouldn't line up 95 // baseline definition, and then inputs of different types wouldn't line up
95 // anymore. 96 // anymore.
96 class LayoutTextControlInnerContainer final : public LayoutFlexibleBox { 97 class LayoutTextControlInnerContainer final : public LayoutFlexibleBox {
97 public: 98 public:
98 explicit LayoutTextControlInnerContainer(Element* element) 99 explicit LayoutTextControlInnerContainer(Element* element)
99 : LayoutFlexibleBox(element) 100 : LayoutFlexibleBox(element)
100 { } 101 { }
101 ~LayoutTextControlInnerContainer() override { } 102 ~LayoutTextControlInnerContainer() override { }
102 103
103 int baselinePosition(FontBaseline baseline, bool firstLine, LineDirectionMod e direction, LinePositionMode position) const override 104 int baselinePosition(FontBaseline baseline, bool firstLine, LineDirectionMod e direction, LinePositionMode position) const override
104 { 105 {
105 return LayoutBlock::baselinePosition(baseline, firstLine, direction, pos ition); 106 return LayoutBlock::baselinePosition(baseline, firstLine, direction, pos ition);
106 } 107 }
107 int firstLineBoxBaseline() const override { return LayoutBlock::firstLineBox Baseline(); } 108 int firstLineBoxBaseline() const override { return LayoutBlock::firstLineBox Baseline(); }
108 int inlineBlockBaseline(LineDirectionMode direction) const override { return lastLineBoxBaseline(direction); } 109 int inlineBlockBaseline(LineDirectionMode direction) const override { return lastLineBoxBaseline(direction); }
109 }; 110 };
110 111
111 112
112 } // namespace blink 113 } // namespace blink
113 114
114 #endif // LayoutTextControl_h 115 #endif // LayoutTextControl_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698