Changeset 249701 in webkit


Ignore:
Timestamp:
Sep 9, 2019 8:50:04 PM (5 years ago)
Author:
timothy@apple.com
Message:

Tap and hold on Facebook sometimes creates a tall empty selection.
https://bugs.webkit.org/show_bug.cgi?id=201618
rdar://53630145

Reviewed by Megan Gardner.

Source/WebCore:

API Test: SelectionTests.ByWordAtEndOfDocument

  • editing/VisibleUnits.cpp:

(WebCore::wordRangeFromPosition):
Remove special case code for the possibility of an empty paragraph and at the end
of the document. This is no longer needed and was causing a large selection to be
created on Facebook due to large areas of non-selectable content on the page.

Tools:

  • TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
  • TestWebKitAPI/Tests/ios/SelectionByWord.mm: Added.
Location:
trunk
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r249686 r249701  
     12019-09-09  Timothy Hatcher  <timothy@apple.com>
     2
     3        Tap and hold on Facebook sometimes creates a tall empty selection.
     4        https://bugs.webkit.org/show_bug.cgi?id=201618
     5        rdar://53630145
     6
     7        Reviewed by Megan Gardner.
     8
     9        API Test: SelectionTests.ByWordAtEndOfDocument
     10
     11        * editing/VisibleUnits.cpp:
     12        (WebCore::wordRangeFromPosition):
     13        Remove special case code for the possibility of an empty paragraph and at the end
     14        of the document. This is no longer needed and was causing a large selection to be
     15        created on Facebook due to large areas of non-selectable content on the page.
     16
    1172019-09-09  Joonghun Park  <jh718.park@samsung.com>
    218
  • trunk/Source/WebCore/editing/VisibleUnits.cpp

    r247881 r249701  
    19701970        range = enclosingTextUnitOfGranularity(position, WordGranularity, DirectionForward);
    19711971    }
     1972
    19721973    if (range)
    19731974        return range;
     
    19781979    } while (currentPosition.isNotNull() && !atBoundaryOfGranularity(currentPosition, WordGranularity, DirectionBackward));
    19791980
    1980     // If the position is an empty paragraph and at the end of the document
    1981     // the word iterator could not pass the paragraph boundary, therefore iterating to
    1982     // the previous line is required.
    1983     if (currentPosition.isNull() && isEndOfDocument(position)) {
    1984         VisiblePosition previousLinePosition = positionOfNextBoundaryOfGranularity(position, LineGranularity, DirectionBackward);
    1985         if (previousLinePosition.isNotNull()) {
    1986             currentPosition = positionOfNextBoundaryOfGranularity(previousLinePosition, WordGranularity, DirectionBackward);
    1987             if (currentPosition.isNull())
    1988                 currentPosition = previousLinePosition;
    1989         }
    1990     }
    1991 
    19921981    if (currentPosition.isNull())
    19931982        currentPosition = positionOfNextBoundaryOfGranularity(position, WordGranularity, DirectionForward);
     
    19971986        ASSERT(range);
    19981987    }
     1988
    19991989    return range;
    20001990}
  • trunk/Tools/ChangeLog

    r249687 r249701  
     12019-09-09  Timothy Hatcher  <timothy@apple.com>
     2
     3        Tap and hold on Facebook sometimes creates a tall empty selection.
     4        https://bugs.webkit.org/show_bug.cgi?id=201618
     5        rdar://53630145
     6
     7        Reviewed by Megan Gardner.
     8
     9        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
     10        * TestWebKitAPI/Tests/ios/SelectionByWord.mm: Added.
     11
    1122019-09-09  Aakash Jain  <aakash_jain@apple.com>
    213
  • trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj

    r249684 r249701  
    105105                1C734B5320788C4800F430EA /* SystemColors.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1C734B5220788C4800F430EA /* SystemColors.mm */; };
    106106                1C7FEB20207C0F2E00D23278 /* BackgroundColor.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1C7FEB1F207C0F2D00D23278 /* BackgroundColor.mm */; };
     107                1C90420C2326E03C00BEF91E /* SelectionByWord.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1C90420B2326E03C00BEF91E /* SelectionByWord.mm */; };
    107108                1C9EB8411E380DA1005C6442 /* ComplexTextController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C9EB8401E380DA1005C6442 /* ComplexTextController.cpp */; };
    108109                1CACADA1230620AE0007D54C /* WKWebViewOpaque.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1CACADA0230620AD0007D54C /* WKWebViewOpaque.mm */; };
     
    15251526                1C734B5220788C4800F430EA /* SystemColors.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SystemColors.mm; sourceTree = "<group>"; };
    15261527                1C7FEB1F207C0F2D00D23278 /* BackgroundColor.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = BackgroundColor.mm; sourceTree = "<group>"; };
     1528                1C90420B2326E03C00BEF91E /* SelectionByWord.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SelectionByWord.mm; sourceTree = "<group>"; };
    15271529                1C9EB8401E380DA1005C6442 /* ComplexTextController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ComplexTextController.cpp; sourceTree = "<group>"; };
    15281530                1CACADA0230620AD0007D54C /* WKWebViewOpaque.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKWebViewOpaque.mm; sourceTree = "<group>"; };
     
    30693071                                F4C8797E2059D8D3009CD00B /* ScrollViewInsetTests.mm */,
    30703072                                0FF1134D22D68679009A81DA /* ScrollViewScrollabilityTests.mm */,
     3073                                1C90420B2326E03C00BEF91E /* SelectionByWord.mm */,
    30713074                                9B4B5EA422DEBE19001E3D5A /* SelectionModifyByParagraphBoundary.mm */,
    30723075                                CE6E819F20A6935F00E2C80F /* SetTimeoutFunction.mm */,
     
    46854688                                0FF1134E22D68679009A81DA /* ScrollViewScrollabilityTests.mm in Sources */,
    46864689                                CE06DF9B1E1851F200E570C9 /* SecurityOrigin.cpp in Sources */,
     4690                                1C90420C2326E03C00BEF91E /* SelectionByWord.mm in Sources */,
    46874691                                9B4B5EA522DEBE19001E3D5A /* SelectionModifyByParagraphBoundary.mm in Sources */,
    46884692                                5769C50B1D9B0002000847FB /* SerializedCryptoKeyWrap.mm in Sources */,
Note: See TracChangeset for help on using the changeset viewer.