Changeset 205246 in webkit


Ignore:
Timestamp:
Aug 31, 2016 2:12:25 AM (8 years ago)
Author:
Antti Koivisto
Message:

REGRESSION (r201701): Unable to copy from CodeMirror editor version used in Jenkins install website
https://bugs.webkit.org/show_bug.cgi?id=161386
<rdar://problem/27590077>

Reviewed by Dan Bernstein.

Source/WebCore:

This CodeMirror version uses a hidden <textarea> to implement copy/paste. The textarea has width:1px; border-width:1px.
Jenkins page has also has a stylesheet that contains * { box-sizing:border-box } and as a result the textarea content
width gets computed as 0. With r201701 we use content size instead of box size for clipping and the textarea content is
(correctly) considered invisible.

Add a quirk that allows this to continue working.

Test: editing/text-iterator/hidden-textarea-selection-quirk.html

  • editing/TextIterator.cpp:

(WebCore::fullyClipsContents):

LayoutTests:

  • editing/text-iterator/hidden-textarea-selection-quirk-expected.txt: Added.
  • editing/text-iterator/hidden-textarea-selection-quirk.html: Added.
  • platform/ios-simulator/editing/text-iterator/hidden-textarea-selection-quirk-expected.txt: Added.

textarea.select() doesn't select the text content on iOS.

Location:
trunk
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r205224 r205246  
     12016-08-31  Antti Koivisto  <antti@apple.com>
     2
     3        REGRESSION (r201701): Unable to copy from CodeMirror editor version used in Jenkins install website
     4        https://bugs.webkit.org/show_bug.cgi?id=161386
     5        <rdar://problem/27590077>
     6
     7        Reviewed by Dan Bernstein.
     8
     9        * editing/text-iterator/hidden-textarea-selection-quirk-expected.txt: Added.
     10        * editing/text-iterator/hidden-textarea-selection-quirk.html: Added.
     11        * platform/ios-simulator/editing/text-iterator/hidden-textarea-selection-quirk-expected.txt: Added.
     12
     13            textarea.select() doesn't select the text content on iOS.
     14
    1152016-08-30  Jiewen Tan  <jiewen_tan@apple.com>
    216
  • trunk/Source/WebCore/ChangeLog

    r205244 r205246  
     12016-08-31  Antti Koivisto  <antti@apple.com>
     2
     3        REGRESSION (r201701): Unable to copy from CodeMirror editor version used in Jenkins install website
     4        https://bugs.webkit.org/show_bug.cgi?id=161386
     5        <rdar://problem/27590077>
     6
     7        Reviewed by Dan Bernstein.
     8
     9        This CodeMirror version uses a hidden <textarea> to implement copy/paste. The textarea has width:1px; border-width:1px.
     10        Jenkins page has also has a stylesheet that contains * { box-sizing:border-box } and as a result the textarea content
     11        width gets computed as 0. With r201701 we use content size instead of box size for clipping and the textarea content is
     12        (correctly) considered invisible.
     13
     14        Add a quirk that allows this to continue working.
     15
     16        Test: editing/text-iterator/hidden-textarea-selection-quirk.html
     17
     18        * editing/TextIterator.cpp:
     19        (WebCore::fullyClipsContents):
     20
    1212016-08-31  Joseph Pecoraro  <pecoraro@apple.com>
    222
  • trunk/Source/WebCore/editing/TextIterator.cpp

    r205011 r205246  
    4141#include "HTMLParagraphElement.h"
    4242#include "HTMLProgressElement.h"
     43#include "HTMLTextAreaElement.h"
    4344#include "HTMLTextFormControlElement.h"
    4445#include "InlineTextBox.h"
     
    214215    if (!box.hasOverflowClip())
    215216        return false;
     217
     218    // Quirk to keep copy/paste in the CodeMirror editor version used in Jenkins working.
     219    if (is<HTMLTextAreaElement>(node))
     220        return box.size().isEmpty();
     221
    216222    return box.contentSize().isEmpty();
    217223}
Note: See TracChangeset for help on using the changeset viewer.