Changeset 238522 in webkit
- Timestamp:
- Nov 26, 2018 2:15:16 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r238520 r238522 1 2018-11-26 Daniel Bates <dabates@apple.com> 2 3 Caret disappears at end of password field when caps lock indicator is shown; password field 4 not scrolled when caps lock indicator is shown 5 https://bugs.webkit.org/show_bug.cgi?id=191164 6 <rdar://problem/45738179> 7 8 Reviewed by Dean Jackson. 9 10 Add a test to ensure that we scroll the password field when caps lock is toggled. 11 12 * TestExpectations: Skip the test on all platforms as we only support toggling Caps Lock in 13 WebKit2 on Mac at the moment. 14 * fast/forms/password-scrolled-after-caps-lock-toggled-expected.txt: Added. 15 * fast/forms/password-scrolled-after-caps-lock-toggled.html: Added. 16 * platform/mac-wk2/TestExpectations: Mark the test as PASS so that we run it. 17 1 18 2018-11-26 Daniel Bates <dabates@apple.com> 2 19 -
trunk/LayoutTests/TestExpectations
r238519 r238522 403 403 fast/forms/auto-fill-button/caps-lock-indicator-should-not-be-visible-when-auto-fill-strong-password-button-is-visible.html [ Skip ] 404 404 fast/repaint/placeholder-after-caps-lock-hidden.html [ Skip ] 405 fast/forms/password-scrolled-after-caps-lock-toggled.html [ Skip ] 405 406 406 407 # This test currently only works for mac-wk2 -
trunk/LayoutTests/platform/mac-wk2/TestExpectations
r238519 r238522 72 72 [ Mojave+ ] fast/forms/auto-fill-button/caps-lock-indicator-should-not-be-visible-when-auto-fill-strong-password-button-is-visible.html [ Pass ] 73 73 [ Mojave+ ] fast/repaint/placeholder-after-caps-lock-hidden.html [ Pass ] 74 [ Mojave+ ] fast/forms/password-scrolled-after-caps-lock-toggled.html [ Pass ] 74 75 75 76 fast/events/inactive-window-no-mouse-event.html [ Pass ] -
trunk/Source/WebCore/ChangeLog
r238519 r238522 1 2018-11-26 Daniel Bates <dabates@apple.com> 2 3 Caret disappears at end of password field when caps lock indicator is shown; password field 4 not scrolled when caps lock indicator is shown 5 https://bugs.webkit.org/show_bug.cgi?id=191164 6 <rdar://problem/45738179> 7 8 Reviewed by Dean Jackson. 9 10 Fixes an issue where the caret may be occluded by- or paint on top of- the caps lock indicator on 11 Mac and iOS, respectively. 12 13 If there has not been a previous selection in a focused password field, including a caret 14 selection made by pressing the arrow keys, then we never scroll the password field to reveal 15 the current selection when the caps lock indicator is made visible. When the caps lock indicator 16 is made visible or hidden the size of the inner text renderer changes as it shrinks or expands 17 to make space for the caps lock indicator or to fill the void of the now hidden caps lock indicator, 18 respectively. We should detect such size changes and schedule an update and reveal of the current 19 selection after layout. 20 21 Test: fast/forms/password-scrolled-after-caps-lock-toggled.html 22 23 * editing/FrameSelection.cpp: 24 (WebCore::FrameSelection::setNeedsSelectionUpdate): Modified to take an enum to override the current 25 selection reveal mode for the next update. 26 * editing/FrameSelection.h: 27 * rendering/RenderTextControlSingleLine.cpp: 28 (WebCore::RenderTextControlSingleLine::layout): Schedule post-layout a selection update that 29 reveals the current selection. We pass FrameSelection::RevealSelectionAfterUpdate::Forced to ensure 30 that the scheduled selection update scrolls to the reveal the current selection regardless of selection 31 reveal mode. This is necessary because typing into a password field does not change the current 32 selection reveal mode. 33 1 34 2018-11-26 Daniel Bates <dabates@apple.com> 2 35 -
trunk/Source/WebCore/editing/FrameSelection.cpp
r238454 r238522 404 404 } 405 405 406 void FrameSelection::setNeedsSelectionUpdate( )406 void FrameSelection::setNeedsSelectionUpdate(RevealSelectionAfterUpdate revealMode) 407 407 { 408 408 m_selectionRevealIntent = AXTextStateChangeIntent(); 409 if (revealMode == RevealSelectionAfterUpdate::Forced) 410 m_selectionRevealMode = SelectionRevealMode::Reveal; 409 411 m_pendingSelectionUpdate = true; 410 412 if (RenderView* view = m_frame->contentRenderer()) -
trunk/Source/WebCore/editing/FrameSelection.h
r238454 r238522 160 160 void updateAppearanceAfterLayout(); 161 161 void scheduleAppearanceUpdateAfterStyleChange(); 162 void setNeedsSelectionUpdate(); 162 163 enum class RevealSelectionAfterUpdate : bool { NotForced, Forced }; 164 void setNeedsSelectionUpdate(RevealSelectionAfterUpdate = RevealSelectionAfterUpdate::NotForced); 163 165 164 166 bool contains(const LayoutPoint&) const; -
trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp
r238519 r238522 111 111 resetOverriddenHeight(containerRenderer, this); 112 112 113 // Save the old size of the inner text (if we have one) as we will need to layout the placeholder if 114 // it changes to keep the size of the placeholder proportional to the size of the inner text. 113 // Save the old size of the inner text (if we have one) as we will need to layout the placeholder 114 // and update selection if it changes. One way the size may change is if text decorations are 115 // toggled. For example, hiding and showing the caps lock indicator will cause a size change. 115 116 LayoutSize oldInnerTextSize; 116 117 if (innerTextRenderer) … … 171 172 centerRenderer(*containerRenderer); 172 173 174 bool innerTextSizeChanged = innerTextRenderer && innerTextRenderer->size() != oldInnerTextSize; 175 173 176 HTMLElement* placeholderElement = inputElement().placeholderElement(); 174 177 if (RenderBox* placeholderBox = placeholderElement ? placeholderElement->renderBox() : 0) { … … 180 183 bool neededLayout = placeholderBox->needsLayout(); 181 184 bool placeholderBoxHadLayout = placeholderBox->everHadLayout(); 182 if (innerTextSize != oldInnerTextSize) {185 if (innerTextSizeChanged) { 183 186 // The caps lock indicator was hidden. Layout the placeholder. Its layout does not affect its parent. 184 187 placeholderBox->setChildNeedsLayout(MarkOnlyThis); … … 210 213 RenderThemeIOS::adjustRoundBorderRadius(mutableStyle(), *this); 211 214 #endif 215 if (innerTextSizeChanged) { 216 // The caps lock indicator was hidden or shown. If it is now visible then it may be occluding 217 // the current selection (say, the caret was after the last character in the text field). 218 // Schedule an update and reveal of the current selection. 219 frame().selection().setNeedsSelectionUpdate(FrameSelection::RevealSelectionAfterUpdate::Forced); 220 } 212 221 } 213 222
Note: See TracChangeset
for help on using the changeset viewer.