Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
Revert "Remove obsolete LTR scrollbar padding hack."
Browse files Browse the repository at this point in the history
Breaks caret rendering at rightmost edge of some situations.

This reverts commit 5fdc15a.

BUG=548596,523969
TBR=chrishtr

Review URL: https://codereview.chromium.org/1451103005

Cr-Commit-Position: refs/heads/master@{#360247}
(cherry picked from commit 4a57b23)

Review URL: https://codereview.chromium.org/1508593002 .

Cr-Commit-Position: refs/branch-heads/2564@{#249}
Cr-Branched-From: 1283eca-refs/heads/master@{#359700}
  • Loading branch information
alexelias committed Dec 7, 2015
1 parent 7d44e9f commit 898972c
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 5 deletions.
36 changes: 36 additions & 0 deletions third_party/WebKit/LayoutTests/TestExpectations
Original file line number Diff line number Diff line change
Expand Up @@ -937,6 +937,42 @@ crbug.com/546538 svg/clip-path/clip-path-nonzero.svg [ NeedsManualRebaseline ]
crbug.com/546538 svg/clip-path/clip-path-evenodd-nonzero.svg [ NeedsManualRebaseline ]
crbug.com/546538 svg/clip-path/clip-path-nonzero-evenodd.svg [ NeedsManualRebaseline ]

crbug.com/548596 css3/selectors3/html/css3-modsel-23.html [ NeedsRebaseline ]
crbug.com/548596 css3/selectors3/html/css3-modsel-69.html [ NeedsRebaseline ]
crbug.com/548596 css3/selectors3/xhtml/css3-modsel-23.xml [ NeedsRebaseline ]
crbug.com/548596 css3/selectors3/xhtml/css3-modsel-69.xml [ NeedsRebaseline ]
crbug.com/548596 css3/selectors3/xml/css3-modsel-23.xml [ NeedsRebaseline ]
crbug.com/548596 css3/selectors3/xml/css3-modsel-69.xml [ NeedsRebaseline ]
crbug.com/548596 editing/input/caret-at-the-edge-of-contenteditable.html [ NeedsRebaseline ]
crbug.com/548596 editing/input/caret-at-the-edge-of-input.html [ NeedsRebaseline ]
crbug.com/548596 editing/input/editable-container-with-word-wrap-normal.html [ NeedsRebaseline ]
crbug.com/548596 editing/pasteboard/drop-text-without-selection.html [ NeedsRebaseline ]
crbug.com/548596 fast/clip/outline-overflowClip.html [ NeedsRebaseline ]
crbug.com/548596 fast/css/text-overflow-input.html [ NeedsRebaseline ]
crbug.com/548596 fast/events/autoscroll.html [ NeedsRebaseline ]
crbug.com/548596 fast/forms/basic-inputs.html [ NeedsRebaseline ]
crbug.com/548596 fast/forms/control-restrict-line-height.html [ NeedsRebaseline ]
crbug.com/548596 fast/forms/input-appearance-preventDefault.html [ NeedsRebaseline ]
crbug.com/548596 fast/forms/input-appearance-selection.html [ NeedsRebaseline ]
crbug.com/548596 fast/forms/input-disabled-color.html [ NeedsRebaseline ]
crbug.com/548596 fast/forms/input-text-drag-down.html [ NeedsRebaseline ]
crbug.com/548596 fast/forms/input-text-scroll-left-on-blur.html [ NeedsRebaseline ]
crbug.com/548596 fast/forms/input-text-word-wrap.html [ NeedsRebaseline ]
crbug.com/548596 fast/forms/input-type-text-min-width.html [ NeedsRebaseline ]
crbug.com/548596 fast/forms/minWidthPercent.html [ NeedsRebaseline ]
crbug.com/548596 fast/forms/tabbing-input-iframe.html [ NeedsRebaseline ]
crbug.com/548596 fast/forms/textfield-outline.html [ NeedsRebaseline ]
crbug.com/548596 fast/overflow/overflow-focus-ring.html [ NeedsRebaseline ]
crbug.com/548596 fast/repaint/caret-invalidation-in-overflow-scroll.html [ NeedsRebaseline ]
crbug.com/548596 fast/replaced/width100percent-searchfield.html [ NeedsRebaseline ]
crbug.com/548596 fast/replaced/width100percent-textfield.html [ NeedsRebaseline ]
crbug.com/548596 tables/mozilla/bugs/bug59354.html [ NeedsRebaseline ]
crbug.com/548596 tables/mozilla/bugs/bug96334.html [ NeedsRebaseline ]
crbug.com/548596 fast/css/input-search-padding.html [ NeedsRebaseline ]
crbug.com/548596 virtual/pointerevent/fast/events/autoscroll.html [ NeedsRebaseline ]
crbug.com/548596 virtual/trustedeventsdefaultaction/fast/events/autoscroll.html [ NeedsRebaseline ]
crbug.com/548596 virtual/syncpaint/fast/repaint/caret-invalidation-in-overflow-scroll.html [ NeedsRebaseline ]

crbug.com/425113 svg/clip-path/clip-path-multiple-children.svg [ Failure ]

crbug.com/480769 http/tests/inspector/service-workers/service-workers-redundant.html [ Crash Pass Slow Failure ]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!DOCTYPE html>
<html>
<head>
<title> Testcase for bug https://bugs.webkit.org/show_bug.cgi?id=89649 </title>
Expand All @@ -16,7 +16,7 @@
<script>
function runTest() {
description('Testcase for bug <a href="http://www.webkit.org/b/89649">http://www.webkit.org/b/89649</a>. \
The test case checks if caret is drawn properly (especially scrolls properly) inside a editable container having word-wrap:normal.');
The test case checks if caret is drawn properly(especially scrolls properly) inside a editable container having word-wrap:normal.');

editableContainer = document.getElementById('test');
editableContainer.focus();
Expand All @@ -38,9 +38,9 @@

debug('<br>Final caret rect is calculated by following constraints');
debug('1) ScrollWidth = text content width + caret width');
debug('2) Caret rect is always within container bounding box (thus subtracting the scroll left)');
shouldBe("startCaretRect.left + editableContainer.scrollWidth - editableContainer.scrollLeft", "finalCaretRect.right");

debug('2) Caret rect is always within container bounding box (thus substracting the scroll left)');
shouldBe("startCaretRect.left + editableContainer.scrollWidth - editableContainer.scrollLeft - caretWidth", "finalCaretRect.right");
document.body.removeChild(editableContainer);
isSuccessfullyParsed();
}
Expand Down
5 changes: 5 additions & 0 deletions third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1856,6 +1856,7 @@ bool LayoutBlockFlow::matchedEndLine(LineLayoutState& layoutState, const InlineB
}

bool LayoutBlockFlow::generatesLineBoxesForInlineChild(LayoutObject* inlineObj)

{
ASSERT(inlineObj->parent() == this);

Expand All @@ -1867,9 +1868,13 @@ bool LayoutBlockFlow::generatesLineBoxesForInlineChild(LayoutObject* inlineObj)
return !it.atEnd();
}


void LayoutBlockFlow::addOverflowFromInlineChildren()
{
LayoutUnit endPadding = hasOverflowClip() ? paddingEnd() : LayoutUnit();
// FIXME: Need to find another way to do this, since scrollbars could show when we don't want them to.
if (hasOverflowClip() && !endPadding && node() && node()->isRootEditableElement() && style()->isLeftToRightDirection())
endPadding = 1;
for (RootInlineBox* curr = firstRootBox(); curr; curr = curr->nextRootBox()) {
addLayoutOverflow(curr->paddedLayoutOverflowRect(endPadding));
LayoutRect visualOverflow = curr->visualOverflowRect(curr->lineTop(), curr->lineBottom());
Expand Down

0 comments on commit 898972c

Please sign in to comment.