Chromium Code Reviews| Index: Source/core/dom/Element.cpp |
| diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp |
| index dfa59f4f2814ce3975f34f7ea37db485ba2c79ae..9764d5f69351ed1be13c40422b97853cc7b74b05 100644 |
| --- a/Source/core/dom/Element.cpp |
| +++ b/Source/core/dom/Element.cpp |
| @@ -468,6 +468,18 @@ void Element::scrollIntoViewIfNeeded(bool centerIfNeeded) |
| return; |
| LayoutRect bounds = boundingBox(); |
| + |
| + // Fix start : for crbug.com/295848. |
|
arpitabahuguna
2014/09/11 14:14:59
You don't need this comment line.
|
| + // The bounding box is computed by considering the y position of element |
| + // which includes the parent's top border. But scrolling does not consider |
| + // border, so this border top should be removed |
|
pals
2014/09/12 13:40:08
. at the end of the comment.
|
| + RenderBox* parentBox = renderer()->enclosingScrollableBox(); |
|
arpitabahuguna
2014/09/11 14:14:59
Why do you name this parentBox??
|
| + if (parentBox && parentBox->borderTop() > 0) { |
|
pals
2014/09/12 13:40:08
{} not needed here.
|
| + bounds.setY(bounds.y().toInt() - parentBox->borderTop()); |
|
pals
2014/09/12 13:40:08
I think scrollRectTOVisible expects absolute rect.
|
| + } |
| + parentBox = 0; |
|
arpitabahuguna
2014/09/11 14:14:58
Not required.
|
| + // Fix end : for crbug.com/295848 |
|
arpitabahuguna
2014/09/11 14:14:59
Again, this line is not required.
|
| + |
| if (centerIfNeeded) |
| renderer()->scrollRectToVisible(bounds, ScrollAlignment::alignCenterIfNeeded, ScrollAlignment::alignCenterIfNeeded); |
| else |