Suppress native placeholder text on MacOS Input Type=Search [chromium/src : master]

0 views
Skip to first unread message

Eric Lawrence (Gerrit)

unread,
Aug 10, 2017, 1:28:49 PM8/10/17
to blink-revi...@chromium.org, blink-...@chromium.org, eae+bli...@chromium.org, jchaffraix...@chromium.org, leviw+re...@chromium.org, mac-r...@chromium.org, pdr+renderi...@chromium.org, szager+la...@chromium.org, zol...@webkit.org, Keishi Hattori, Erik Chen, Commit Bot, chromium...@chromium.org

PTAL?

View Change

    To view, visit change 610501. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: master
    Gerrit-MessageType: comment
    Gerrit-Change-Id: I0da791fa3510d682731c5d64971ac669a7608d5a
    Gerrit-Change-Number: 610501
    Gerrit-PatchSet: 1
    Gerrit-Owner: Eric Lawrence <elaw...@chromium.org>
    Gerrit-Reviewer: Eric Lawrence <elaw...@chromium.org>
    Gerrit-Reviewer: Erik Chen <erik...@chromium.org>
    Gerrit-Reviewer: Keishi Hattori <kei...@chromium.org>
    Gerrit-CC: Commit Bot <commi...@chromium.org>
    Gerrit-Comment-Date: Thu, 10 Aug 2017 17:28:44 +0000
    Gerrit-HasComments: No
    Gerrit-HasLabels: No

    Keishi Hattori (Gerrit)

    unread,
    Aug 10, 2017, 1:32:11 PM8/10/17
    to Eric Lawrence, blink-revi...@chromium.org, blink-...@chromium.org, eae+bli...@chromium.org, jchaffraix...@chromium.org, leviw+re...@chromium.org, mac-r...@chromium.org, pdr+renderi...@chromium.org, szager+la...@chromium.org, zol...@webkit.org, Erik Chen, Commit Bot, chromium...@chromium.org

    Patch set 1:Code-Review +1

    Gerrit-Comment-Date: Thu, 10 Aug 2017 17:32:04 +0000
    Gerrit-HasComments: No
    Gerrit-HasLabels: Yes

    Erik Chen (Gerrit)

    unread,
    Aug 14, 2017, 12:02:08 PM8/14/17
    to Eric Lawrence, blink-revi...@chromium.org, blink-...@chromium.org, eae+bli...@chromium.org, jchaffraix...@chromium.org, leviw+re...@chromium.org, mac-r...@chromium.org, pdr+renderi...@chromium.org, szager+la...@chromium.org, zol...@webkit.org, Keishi Hattori, Commit Bot, chromium...@chromium.org

    View Change

    1 comment:

    To view, visit change 610501. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: master
    Gerrit-MessageType: comment
    Gerrit-Change-Id: I0da791fa3510d682731c5d64971ac669a7608d5a
    Gerrit-Change-Number: 610501
    Gerrit-PatchSet: 1
    Gerrit-Owner: Eric Lawrence <elaw...@chromium.org>
    Gerrit-Reviewer: Eric Lawrence <elaw...@chromium.org>
    Gerrit-Reviewer: Erik Chen <erik...@chromium.org>
    Gerrit-Reviewer: Keishi Hattori <kei...@chromium.org>
    Gerrit-CC: Commit Bot <commi...@chromium.org>
    Gerrit-Comment-Date: Mon, 14 Aug 2017 16:01:57 +0000
    Gerrit-HasComments: Yes
    Gerrit-HasLabels: No

    Eric Lawrence (Gerrit)

    unread,
    Aug 14, 2017, 12:21:49 PM8/14/17
    to blink-revi...@chromium.org, blink-...@chromium.org, eae+bli...@chromium.org, jchaffraix...@chromium.org, leviw+re...@chromium.org, mac-r...@chromium.org, pdr+renderi...@chromium.org, szager+la...@chromium.org, zol...@webkit.org, Erik Chen, Keishi Hattori, Commit Bot, chromium...@chromium.org

    Patch Set 1:

    (1 comment)

    View Change

    1 comment:

      • I'm not an expert on the Mac SDK, but my understanding from reading the docs (and the Mozilla bug tracker) is that the setPlaceholderString function works properly in iOS 10.3 and later.

        Do we have any older MacOS versions around that I could test with?

    To view, visit change 610501. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: master
    Gerrit-MessageType: comment
    Gerrit-Change-Id: I0da791fa3510d682731c5d64971ac669a7608d5a
    Gerrit-Change-Number: 610501
    Gerrit-PatchSet: 1
    Gerrit-Owner: Eric Lawrence <elaw...@chromium.org>
    Gerrit-Reviewer: Eric Lawrence <elaw...@chromium.org>
    Gerrit-Reviewer: Erik Chen <erik...@chromium.org>
    Gerrit-Reviewer: Keishi Hattori <kei...@chromium.org>
    Gerrit-CC: Commit Bot <commi...@chromium.org>
    Gerrit-Comment-Date: Mon, 14 Aug 2017 16:21:45 +0000
    Gerrit-HasComments: Yes
    Gerrit-HasLabels: No

    Erik Chen (Gerrit)

    unread,
    Aug 14, 2017, 12:23:59 PM8/14/17
    to Eric Lawrence, blink-revi...@chromium.org, blink-...@chromium.org, eae+bli...@chromium.org, jchaffraix...@chromium.org, leviw+re...@chromium.org, mac-r...@chromium.org, pdr+renderi...@chromium.org, szager+la...@chromium.org, zol...@webkit.org, Keishi Hattori, Commit Bot, chromium...@chromium.org

    Patch Set 1:

    (1 comment)

    Patch Set 1:

    (1 comment)

    View Change

    1 comment:

      • Do we have any older MacOS versions around that I could test with?

        Yes...Are you in MTV? If so, come find me in the afternoon.

      •  is that the setPlaceholderString function works properly in iOS 10.3 and later. 
      • iOS != macOS. The versioning is unrelated.

    To view, visit change 610501. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: master
    Gerrit-MessageType: comment
    Gerrit-Change-Id: I0da791fa3510d682731c5d64971ac669a7608d5a
    Gerrit-Change-Number: 610501
    Gerrit-PatchSet: 1
    Gerrit-Owner: Eric Lawrence <elaw...@chromium.org>
    Gerrit-Reviewer: Eric Lawrence <elaw...@chromium.org>
    Gerrit-Reviewer: Erik Chen <erik...@chromium.org>
    Gerrit-Reviewer: Keishi Hattori <kei...@chromium.org>
    Gerrit-CC: Commit Bot <commi...@chromium.org>
    Gerrit-Comment-Date: Mon, 14 Aug 2017 16:23:54 +0000
    Gerrit-HasComments: Yes
    Gerrit-HasLabels: No

    Eric Lawrence (Gerrit)

    unread,
    Aug 14, 2017, 12:52:18 PM8/14/17
    to blink-revi...@chromium.org, blink-...@chromium.org, eae+bli...@chromium.org, jchaffraix...@chromium.org, leviw+re...@chromium.org, mac-r...@chromium.org, pdr+renderi...@chromium.org, szager+la...@chromium.org, zol...@webkit.org, Erik Chen, Keishi Hattori, Commit Bot, chromium...@chromium.org

    Patch Set 1:

    (1 comment)

    Patch Set 1:

    (1 comment)

    Patch Set 1:

    (1 comment)

    View Change

    1 comment:

      • Patch Set #1, Line 980: [search_.Get() setPlaceholderString:@""];

        > Do we have any older MacOS versions around that I could test with?

      • Sorry, I mistyped, I meant "OS X 10.3".

        Unfortunately, I'm in Austin, not MTV.

        If your older Mac is configured appropriately, it should be straightforward to run the binaries built off the bots?

        git clone https://github.com/luci/luci-py
        python isolateserver.py download -I https://isolateserver.appspot.com --namespace default-gzip -s d3e7f3eb915eaea39c275e385425a08a2f62c4d8 --target NoPlaceholderTest

    To view, visit change 610501. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: master
    Gerrit-MessageType: comment
    Gerrit-Change-Id: I0da791fa3510d682731c5d64971ac669a7608d5a
    Gerrit-Change-Number: 610501
    Gerrit-PatchSet: 1
    Gerrit-Owner: Eric Lawrence <elaw...@chromium.org>
    Gerrit-Reviewer: Eric Lawrence <elaw...@chromium.org>
    Gerrit-Reviewer: Erik Chen <erik...@chromium.org>
    Gerrit-Reviewer: Keishi Hattori <kei...@chromium.org>
    Gerrit-CC: Commit Bot <commi...@chromium.org>
    Gerrit-Comment-Date: Mon, 14 Aug 2017 16:52:14 +0000
    Gerrit-HasComments: Yes
    Gerrit-HasLabels: No

    Erik Chen (Gerrit)

    unread,
    Aug 14, 2017, 2:08:21 PM8/14/17
    to Robert Sesek, Kent Tamura, blink-revi...@chromium.org, blink-...@chromium.org, eae+bli...@chromium.org, jchaffraix...@chromium.org, leviw+re...@chromium.org, mac-r...@chromium.org, pdr+renderi...@chromium.org, szager+la...@chromium.org, zol...@webkit.org, Eric Lawrence, Keishi Hattori

    Erik Chen would like Robert Sesek and Kent Tamura to review this change.

    View Change

    Suppress native placeholder text on MacOS Input Type=Search

    The OS X 10.11 SDK introduced a change whereby the "Search" placeholder
    text is no longer suppressed by setting setCenteredLook to NO on the
    NSSearchFieldCell control. Instead, we now explicitly invoke
    |setPlaceholderString| on the control.

    Bug: 752362
    Change-Id: I0da791fa3510d682731c5d64971ac669a7608d5a
    ---
    M third_party/WebKit/Source/core/layout/LayoutThemeMac.mm
    1 file changed, 1 insertion(+), 12 deletions(-)

    diff --git a/third_party/WebKit/Source/core/layout/LayoutThemeMac.mm b/third_party/WebKit/Source/core/layout/LayoutThemeMac.mm
    index df13deb..a43eadd 100644
    --- a/third_party/WebKit/Source/core/layout/LayoutThemeMac.mm
    +++ b/third_party/WebKit/Source/core/layout/LayoutThemeMac.mm
    @@ -977,18 +977,7 @@
    [search_.Get() setBezeled:YES];
    [search_.Get() setEditable:YES];
    [search_.Get() setFocusRingType:NSFocusRingTypeExterior];
    - SEL sel = @selector(setCenteredLook:);
    - if ([search_.Get() respondsToSelector:sel]) {
    - BOOL bool_value = NO;
    - NSMethodSignature* signature =
    - [NSSearchFieldCell instanceMethodSignatureForSelector:sel];
    - NSInvocation* invocation =
    - [NSInvocation invocationWithMethodSignature:signature];
    - [invocation setTarget:search_.Get()];
    - [invocation setSelector:sel];
    - [invocation setArgument:&bool_value atIndex:2];
    - [invocation invoke];
    - }
    + [search_.Get() setPlaceholderString:@""];
    }

    return search_.Get();

    To view, visit change 610501. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: master
    Gerrit-MessageType: newchange
    Gerrit-Change-Id: I0da791fa3510d682731c5d64971ac669a7608d5a
    Gerrit-Change-Number: 610501
    Gerrit-PatchSet: 1
    Gerrit-Owner: Eric Lawrence <elaw...@chromium.org>
    Gerrit-Reviewer: Eric Lawrence <elaw...@chromium.org>
    Gerrit-Reviewer: Erik Chen <erik...@chromium.org>
    Gerrit-Reviewer: Keishi Hattori <kei...@chromium.org>
    Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
    Gerrit-Reviewer: Robert Sesek <rse...@chromium.org>

    Erik Chen (Gerrit)

    unread,
    Aug 14, 2017, 2:08:25 PM8/14/17
    to Eric Lawrence, blink-revi...@chromium.org, blink-...@chromium.org, eae+bli...@chromium.org, jchaffraix...@chromium.org, leviw+re...@chromium.org, mac-r...@chromium.org, pdr+renderi...@chromium.org, szager+la...@chromium.org, zol...@webkit.org, Kent Tamura, Robert Sesek, Keishi Hattori, Commit Bot, chromium...@chromium.org

    Working on getting an older macOS device. In the meanwhile...

    The code you're removing was explicitly added to remove the default placeholder:
    https://codereview.chromium.org/586413002

    It was based on a WebKit change: https://trac.webkit.org/changeset/168870/webkit which seems to be solving a different problem:
    https://bugs.webkit.org/show_bug.cgi?id=132930

    What I would like to understand is whether centeredLook = NO has other side effects that we want to keep.

    Adding original authors/reviewers in case they still remember.

    View Change

      To view, visit change 610501. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: chromium/src
      Gerrit-Branch: master
      Gerrit-MessageType: comment
      Gerrit-Change-Id: I0da791fa3510d682731c5d64971ac669a7608d5a
      Gerrit-Change-Number: 610501
      Gerrit-PatchSet: 1
      Gerrit-Owner: Eric Lawrence <elaw...@chromium.org>
      Gerrit-Reviewer: Eric Lawrence <elaw...@chromium.org>
      Gerrit-Reviewer: Erik Chen <erik...@chromium.org>
      Gerrit-Reviewer: Keishi Hattori <kei...@chromium.org>
      Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
      Gerrit-Reviewer: Robert Sesek <rse...@chromium.org>
      Gerrit-CC: Commit Bot <commi...@chromium.org>
      Gerrit-Comment-Date: Mon, 14 Aug 2017 18:08:15 +0000
      Gerrit-HasComments: No
      Gerrit-HasLabels: No

      Eric Lawrence (Gerrit)

      unread,
      Aug 14, 2017, 3:39:30 PM8/14/17
      to blink-revi...@chromium.org, blink-...@chromium.org, eae+bli...@chromium.org, jchaffraix...@chromium.org, leviw+re...@chromium.org, mac-r...@chromium.org, pdr+renderi...@chromium.org, szager+la...@chromium.org, zol...@webkit.org, Kent Tamura, Robert Sesek, Erik Chen, Keishi Hattori, Commit Bot, chromium...@chromium.org

      Patch Set 1:

      Working on getting an older macOS device. In the meanwhile...

      The code you're removing was explicitly added to remove the default placeholder:
      https://codereview.chromium.org/586413002

      It was based on a WebKit change: https://trac.webkit.org/changeset/168870/webkit which seems to be solving a different problem:
      https://bugs.webkit.org/show_bug.cgi?id=132930

      What I would like to understand is whether centeredLook = NO has other side effects that we want to keep.

      Adding original authors/reviewers in case they still remember.

      I /think/ centeredLook doesn't have other effects that are relevant to us. In Blink, we suppress the Search field's built-in icon (a magnifying glass) so the only remaining visible piece is the placeholder text that this CL suppresses.

      (You can see a Search field that uses the default centeredLook atop the OS X built-in "Mail" app).

      View Change

        To view, visit change 610501. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-Project: chromium/src
        Gerrit-Branch: master
        Gerrit-MessageType: comment
        Gerrit-Change-Id: I0da791fa3510d682731c5d64971ac669a7608d5a
        Gerrit-Change-Number: 610501
        Gerrit-PatchSet: 1
        Gerrit-Owner: Eric Lawrence <elaw...@chromium.org>
        Gerrit-Reviewer: Eric Lawrence <elaw...@chromium.org>
        Gerrit-Reviewer: Erik Chen <erik...@chromium.org>
        Gerrit-Reviewer: Keishi Hattori <kei...@chromium.org>
        Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
        Gerrit-Reviewer: Robert Sesek <rse...@chromium.org>
        Gerrit-CC: Commit Bot <commi...@chromium.org>
        Gerrit-Comment-Date: Mon, 14 Aug 2017 19:39:27 +0000
        Gerrit-HasComments: No
        Gerrit-HasLabels: No

        Erik Chen (Gerrit)

        unread,
        Aug 14, 2017, 5:05:06 PM8/14/17
        to Eric Lawrence, blink-revi...@chromium.org, blink-...@chromium.org, eae+bli...@chromium.org, jchaffraix...@chromium.org, leviw+re...@chromium.org, mac-r...@chromium.org, pdr+renderi...@chromium.org, szager+la...@chromium.org, zol...@webkit.org, Kent Tamura, Robert Sesek, Keishi Hattori, Commit Bot, chromium...@chromium.org

        Patch Set 1:

        Patch Set 1:

        Working on getting an older macOS device. In the meanwhile...

        The code you're removing was explicitly added to remove the default placeholder:
        https://codereview.chromium.org/586413002

        It was based on a WebKit change: https://trac.webkit.org/changeset/168870/webkit which seems to be solving a different problem:
        https://bugs.webkit.org/show_bug.cgi?id=132930

        What I would like to understand is whether centeredLook = NO has other side effects that we want to keep.

        Adding original authors/reviewers in case they still remember.

        I /think/ centeredLook doesn't have other effects that are relevant to us. In Blink, we suppress the Search field's built-in icon (a magnifying glass) so the only remaining visible piece is the placeholder text that this CL suppresses.

        (You can see a Search field that uses the default centeredLook atop the OS X built-in "Mail" app).

        Still haven't managed to get a hold of a 10.10 machine. I suppose that if there were a visible effect, we'd expect the layout tests to catch the change. For that matter, I'm kind of surprised this behavior change *wasn't* caught by the layout tests...and then I remembered that the layout tests are still building against the 10.10 SDK. [they're the last holdout].

        But the fact that this CL doesn't cause the layout tests to fail suggests that this has the appropriate behavior.

        Patch set 1:Code-Review +1

        View Change

          To view, visit change 610501. To unsubscribe, or for help writing mail filters, visit settings.

          Gerrit-Project: chromium/src
          Gerrit-Branch: master
          Gerrit-MessageType: comment
          Gerrit-Change-Id: I0da791fa3510d682731c5d64971ac669a7608d5a
          Gerrit-Change-Number: 610501
          Gerrit-PatchSet: 1
          Gerrit-Owner: Eric Lawrence <elaw...@chromium.org>
          Gerrit-Reviewer: Eric Lawrence <elaw...@chromium.org>
          Gerrit-Reviewer: Erik Chen <erik...@chromium.org>
          Gerrit-Reviewer: Keishi Hattori <kei...@chromium.org>
          Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
          Gerrit-Reviewer: Robert Sesek <rse...@chromium.org>
          Gerrit-CC: Commit Bot <commi...@chromium.org>
          Gerrit-Comment-Date: Mon, 14 Aug 2017 21:05:01 +0000
          Gerrit-HasComments: No
          Gerrit-HasLabels: Yes

          Eric Lawrence (Gerrit)

          unread,
          Aug 14, 2017, 7:26:34 PM8/14/17
          to blink-revi...@chromium.org, blink-...@chromium.org, eae+bli...@chromium.org, jchaffraix...@chromium.org, leviw+re...@chromium.org, mac-r...@chromium.org, pdr+renderi...@chromium.org, szager+la...@chromium.org, zol...@webkit.org, Erik Chen, Kent Tamura, Robert Sesek, Keishi Hattori, Commit Bot, chromium...@chromium.org

          But the fact that this CL doesn't cause the layout tests to fail suggests that this has the appropriate behavior.

          Indeed, the original regression presumably would have broken the
          \src\third_party\WebKit\LayoutTests\fast\forms\search\search-appearance-basic.html image if the 10.11 SDK were linked.

          I dug up an old Mac running 10.10.5 Mavericks and was surprised to discover that the change in this CL did not work as expected. On 10.10.5 running the latest 62.3185 Canary, the placeholder text is hidden. When running a private build of the current patchset, the unwanted placeholder text reappears. More surprisingly to me, Firefox does not show the placeholder despite (seemingly) using only the same setPlaceholderString call.

          Patch set 1:Code-Review -1

          View Change

            To view, visit change 610501. To unsubscribe, or for help writing mail filters, visit settings.

            Gerrit-Project: chromium/src
            Gerrit-Branch: master
            Gerrit-MessageType: comment
            Gerrit-Change-Id: I0da791fa3510d682731c5d64971ac669a7608d5a
            Gerrit-Change-Number: 610501
            Gerrit-PatchSet: 1
            Gerrit-Owner: Eric Lawrence <elaw...@chromium.org>
            Gerrit-Reviewer: Eric Lawrence <elaw...@chromium.org>
            Gerrit-Reviewer: Erik Chen <erik...@chromium.org>
            Gerrit-Reviewer: Keishi Hattori <kei...@chromium.org>
            Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
            Gerrit-Reviewer: Robert Sesek <rse...@chromium.org>
            Gerrit-CC: Commit Bot <commi...@chromium.org>
            Gerrit-Comment-Date: Mon, 14 Aug 2017 23:26:29 +0000
            Gerrit-HasComments: No
            Gerrit-HasLabels: Yes

            Kent Tamura (Gerrit)

            unread,
            Aug 16, 2017, 7:34:23 PM8/16/17
            to Eric Lawrence, blink-revi...@chromium.org, blink-...@chromium.org, eae+bli...@chromium.org, jchaffraix...@chromium.org, leviw+re...@chromium.org, mac-r...@chromium.org, pdr+renderi...@chromium.org, szager+la...@chromium.org, zol...@webkit.org, Kent Tamura, Erik Chen, Robert Sesek, Keishi Hattori, Commit Bot, chromium...@chromium.org

            Patch Set 2 lgtm.
            Do we still need NSInvocation with the current SDK?

            Patch set 2:Code-Review +1

            View Change

              To view, visit change 610501. To unsubscribe, or for help writing mail filters, visit settings.

              Gerrit-Project: chromium/src
              Gerrit-Branch: master
              Gerrit-MessageType: comment
              Gerrit-Change-Id: I0da791fa3510d682731c5d64971ac669a7608d5a
              Gerrit-Change-Number: 610501
              Gerrit-PatchSet: 2
              Gerrit-Owner: Eric Lawrence <elaw...@chromium.org>
              Gerrit-Reviewer: Eric Lawrence <elaw...@chromium.org>
              Gerrit-Reviewer: Erik Chen <erik...@chromium.org>
              Gerrit-Reviewer: Keishi Hattori <kei...@chromium.org>
              Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
              Gerrit-Reviewer: Robert Sesek <rse...@chromium.org>
              Gerrit-CC: Commit Bot <commi...@chromium.org>
              Gerrit-Comment-Date: Wed, 16 Aug 2017 23:34:18 +0000
              Gerrit-HasComments: No
              Gerrit-HasLabels: Yes

              Erik Chen (Gerrit)

              unread,
              Aug 17, 2017, 5:55:50 PM8/17/17
              to Eric Lawrence, blink-revi...@chromium.org, blink-...@chromium.org, eae+bli...@chromium.org, jchaffraix...@chromium.org, leviw+re...@chromium.org, mac-r...@chromium.org, pdr+renderi...@chromium.org, szager+la...@chromium.org, zol...@webkit.org, Kent Tamura, Robert Sesek, Keishi Hattori, Commit Bot, chromium...@chromium.org

              lgtm with nit


              I dug up an old Mac running 10.10.5 Mavericks and was surprised to discover that the change in this CL did not work as expected. On 10.10.5 running the latest 62.3185 Canary, the placeholder text is hidden. When running a private build of the current patchset, the unwanted placeholder text reappears. More surprisingly to me, Firefox does not show the placeholder despite (seemingly) using only the same setPlaceholderString call.

              Interesting. Presumably this is why the original code didn't just call setPlaceholderText:@"".

              View Change

              1 comment:

              To view, visit change 610501. To unsubscribe, or for help writing mail filters, visit settings.

              Gerrit-Project: chromium/src
              Gerrit-Branch: master
              Gerrit-MessageType: comment
              Gerrit-Change-Id: I0da791fa3510d682731c5d64971ac669a7608d5a
              Gerrit-Change-Number: 610501
              Gerrit-PatchSet: 2
              Gerrit-Owner: Eric Lawrence <elaw...@chromium.org>
              Gerrit-Reviewer: Eric Lawrence <elaw...@chromium.org>
              Gerrit-Reviewer: Erik Chen <erik...@chromium.org>
              Gerrit-Reviewer: Keishi Hattori <kei...@chromium.org>
              Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
              Gerrit-Reviewer: Robert Sesek <rse...@chromium.org>
              Gerrit-CC: Commit Bot <commi...@chromium.org>
              Gerrit-Comment-Date: Thu, 17 Aug 2017 21:55:47 +0000
              Gerrit-HasComments: Yes
              Gerrit-HasLabels: No

              Eric Lawrence (Gerrit)

              unread,
              Aug 17, 2017, 6:15:53 PM8/17/17
              to blink-revi...@chromium.org, blink-...@chromium.org, eae+bli...@chromium.org, jchaffraix...@chromium.org, leviw+re...@chromium.org, mac-r...@chromium.org, pdr+renderi...@chromium.org, szager+la...@chromium.org, zol...@webkit.org, Erik Chen, Kent Tamura, Robert Sesek, Keishi Hattori, Commit Bot, chromium...@chromium.org

              >> reappears. More surprisingly to me, Firefox does not show the placeholder
              >> despite (seemingly) using only the same setPlaceholderString call.
              > Interesting. Presumably this is why the original code didn't just call setPlaceholderText:@"".

              I built a small Cocoa test app last night and confirmed that setPlaceholderString() isn't effective on 10.10. Interestingly, the Firefox stuff was all a bit of a red herring, insofar as Firefox Nightly is still using the 10.7 SDK, but they're not using NSSearchField at all for their HTML rendering; they use a plain text field. (They use a NSSearchField in their XUL Bookmark manager, and it shows the placeholder text on 10.10 but hides it on 10.12).

              View Change

              1 comment:

                • My presumption, based on the existence of the platform/mac/VersionUtilMac.h and its contents, was that it would not be appropriate for this code to rely upon /base/mac/mac_util.h.

                  If that's not the case, I'm happy to change it?

              To view, visit change 610501. To unsubscribe, or for help writing mail filters, visit settings.

              Gerrit-Project: chromium/src
              Gerrit-Branch: master
              Gerrit-MessageType: comment
              Gerrit-Change-Id: I0da791fa3510d682731c5d64971ac669a7608d5a
              Gerrit-Change-Number: 610501
              Gerrit-PatchSet: 2
              Gerrit-Owner: Eric Lawrence <elaw...@chromium.org>
              Gerrit-Reviewer: Eric Lawrence <elaw...@chromium.org>
              Gerrit-Reviewer: Erik Chen <erik...@chromium.org>
              Gerrit-Reviewer: Keishi Hattori <kei...@chromium.org>
              Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
              Gerrit-Reviewer: Robert Sesek <rse...@chromium.org>
              Gerrit-CC: Commit Bot <commi...@chromium.org>
              Gerrit-Comment-Date: Thu, 17 Aug 2017 22:15:50 +0000
              Gerrit-HasComments: Yes
              Gerrit-HasLabels: No

              Kent Tamura (Gerrit)

              unread,
              Aug 17, 2017, 6:50:00 PM8/17/17
              to Eric Lawrence, blink-revi...@chromium.org, blink-...@chromium.org, eae+bli...@chromium.org, jchaffraix...@chromium.org, leviw+re...@chromium.org, mac-r...@chromium.org, pdr+renderi...@chromium.org, szager+la...@chromium.org, zol...@webkit.org, Kent Tamura, Erik Chen, Robert Sesek, Keishi Hattori, Commit Bot, chromium...@chromium.org

              View Change

              1 comment:

                • My presumption, based on the existence of the platform/mac/VersionUtilMac. […]

                  We have a plan to use base:: in Blink core, but I think it's not ready yet. Using VersionUtilMac.h is safer.

              To view, visit change 610501. To unsubscribe, or for help writing mail filters, visit settings.

              Gerrit-Project: chromium/src
              Gerrit-Branch: master
              Gerrit-MessageType: comment
              Gerrit-Change-Id: I0da791fa3510d682731c5d64971ac669a7608d5a
              Gerrit-Change-Number: 610501
              Gerrit-PatchSet: 2
              Gerrit-Owner: Eric Lawrence <elaw...@chromium.org>
              Gerrit-Reviewer: Eric Lawrence <elaw...@chromium.org>
              Gerrit-Reviewer: Erik Chen <erik...@chromium.org>
              Gerrit-Reviewer: Keishi Hattori <kei...@chromium.org>
              Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
              Gerrit-Reviewer: Robert Sesek <rse...@chromium.org>
              Gerrit-CC: Commit Bot <commi...@chromium.org>
              Gerrit-Comment-Date: Thu, 17 Aug 2017 22:49:54 +0000
              Gerrit-HasComments: Yes
              Gerrit-HasLabels: No

              Erik Chen (Gerrit)

              unread,
              Aug 18, 2017, 3:21:11 AM8/18/17
              to Eric Lawrence, blink-revi...@chromium.org, blink-...@chromium.org, eae+bli...@chromium.org, jchaffraix...@chromium.org, leviw+re...@chromium.org, mac-r...@chromium.org, pdr+renderi...@chromium.org, szager+la...@chromium.org, zol...@webkit.org, Kent Tamura, Robert Sesek, Keishi Hattori, Commit Bot, chromium...@chromium.org

              Patch Set 2:

              (1 comment)

              got it thanks, still lgtm

              View Change

                To view, visit change 610501. To unsubscribe, or for help writing mail filters, visit settings.

                Gerrit-Project: chromium/src
                Gerrit-Branch: master
                Gerrit-MessageType: comment
                Gerrit-Change-Id: I0da791fa3510d682731c5d64971ac669a7608d5a
                Gerrit-Change-Number: 610501
                Gerrit-PatchSet: 2
                Gerrit-Owner: Eric Lawrence <elaw...@chromium.org>
                Gerrit-Reviewer: Eric Lawrence <elaw...@chromium.org>
                Gerrit-Reviewer: Erik Chen <erik...@chromium.org>
                Gerrit-Reviewer: Keishi Hattori <kei...@chromium.org>
                Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
                Gerrit-Reviewer: Robert Sesek <rse...@chromium.org>
                Gerrit-CC: Commit Bot <commi...@chromium.org>
                Gerrit-Comment-Date: Fri, 18 Aug 2017 07:21:08 +0000
                Gerrit-HasComments: No
                Gerrit-HasLabels: No

                Eric Lawrence (Gerrit)

                unread,
                Aug 18, 2017, 8:26:02 AM8/18/17
                to blink-revi...@chromium.org, blink-...@chromium.org, eae+bli...@chromium.org, jchaffraix...@chromium.org, leviw+re...@chromium.org, mac-r...@chromium.org, pdr+renderi...@chromium.org, szager+la...@chromium.org, zol...@webkit.org, Erik Chen, Kent Tamura, Robert Sesek, Keishi Hattori, Commit Bot, chromium...@chromium.org

                Thanks, all!

                Patch set 2:Code-Review +1Commit-Queue +2

                View Change

                1 comment:

                  • We have a plan to use base:: in Blink core, but I think it's not ready yet. Using VersionUtilMac. […]

                    Ack

                To view, visit change 610501. To unsubscribe, or for help writing mail filters, visit settings.

                Gerrit-Project: chromium/src
                Gerrit-Branch: master
                Gerrit-MessageType: comment
                Gerrit-Change-Id: I0da791fa3510d682731c5d64971ac669a7608d5a
                Gerrit-Change-Number: 610501
                Gerrit-PatchSet: 2
                Gerrit-Owner: Eric Lawrence <elaw...@chromium.org>
                Gerrit-Reviewer: Eric Lawrence <elaw...@chromium.org>
                Gerrit-Reviewer: Erik Chen <erik...@chromium.org>
                Gerrit-Reviewer: Keishi Hattori <kei...@chromium.org>
                Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
                Gerrit-Reviewer: Robert Sesek <rse...@chromium.org>
                Gerrit-CC: Commit Bot <commi...@chromium.org>
                Gerrit-Comment-Date: Fri, 18 Aug 2017 12:25:52 +0000
                Gerrit-HasComments: Yes
                Gerrit-HasLabels: Yes

                Commit Bot (Gerrit)

                unread,
                Aug 18, 2017, 10:56:24 AM8/18/17
                to Eric Lawrence, blink-revi...@chromium.org, blink-...@chromium.org, eae+bli...@chromium.org, jchaffraix...@chromium.org, leviw+re...@chromium.org, mac-r...@chromium.org, pdr+renderi...@chromium.org, szager+la...@chromium.org, zol...@webkit.org, Erik Chen, Kent Tamura, Robert Sesek, Keishi Hattori, chromium...@chromium.org

                Commit Bot merged this change.

                View Change

                Approvals: Erik Chen: Looks good to me Keishi Hattori: Looks good to me Kent Tamura: Looks good to me Eric Lawrence: Looks good to me; Commit
                Suppress native placeholder text on MacOS Input Type=Search

                The OS X 10.11 SDK introduced a change whereby the "Search" placeholder
                text is no longer suppressed by setting setCenteredLook to NO on the
                NSSearchFieldCell control. Instead, we now explicitly invoke
                |setPlaceholderString| on the control.

                Bug: 752362
                Change-Id: I0da791fa3510d682731c5d64971ac669a7608d5a
                Reviewed-on: https://chromium-review.googlesource.com/610501
                Reviewed-by: Kent Tamura <tk...@chromium.org>
                Reviewed-by: Eric Lawrence <elaw...@chromium.org>
                Reviewed-by: Keishi Hattori <kei...@chromium.org>
                Reviewed-by: Erik Chen <erik...@chromium.org>
                Commit-Queue: Eric Lawrence <elaw...@chromium.org>
                Cr-Commit-Position: refs/heads/master@{#495549}
                ---
                M third_party/WebKit/Source/core/layout/LayoutThemeMac.mm
                1 file changed, 20 insertions(+), 11 deletions(-)

                diff --git a/third_party/WebKit/Source/core/layout/LayoutThemeMac.mm b/third_party/WebKit/Source/core/layout/LayoutThemeMac.mm
                index df13deb..49c01e1 100644
                --- a/third_party/WebKit/Source/core/layout/LayoutThemeMac.mm
                +++ b/third_party/WebKit/Source/core/layout/LayoutThemeMac.mm
                @@ -977,17 +977,26 @@

                [search_.Get() setBezeled:YES];
                [search_.Get() setEditable:YES];
                [search_.Get() setFocusRingType:NSFocusRingTypeExterior];
                - SEL sel = @selector(setCenteredLook:);
                - if ([search_.Get() respondsToSelector:sel]) {
                - BOOL bool_value = NO;
                - NSMethodSignature* signature =
                - [NSSearchFieldCell instanceMethodSignatureForSelector:sel];
                - NSInvocation* invocation =
                - [NSInvocation invocationWithMethodSignature:signature];
                - [invocation setTarget:search_.Get()];
                - [invocation setSelector:sel];
                - [invocation setArgument:&bool_value atIndex:2];
                - [invocation invoke];
                +
                + // Suppress NSSearchFieldCell's default placeholder text. Prior to OS10.11,
                + // this is achieved by calling |setCenteredLook| with NO. In OS10.11 and
                + // later, instead call |setPlaceholderString| with an empty string.
                + // See https://crbug.com/752362.
                + if (IsOS10_9() || IsOS10_10()) {
                + SEL sel = @selector(setCenteredLook:);
                + if ([search_.Get() respondsToSelector:sel]) {
                + BOOL bool_value = NO;
                + NSMethodSignature* signature =
                + [NSSearchFieldCell instanceMethodSignatureForSelector:sel];
                + NSInvocation* invocation =
                + [NSInvocation invocationWithMethodSignature:signature];
                + [invocation setTarget:search_.Get()];
                + [invocation setSelector:sel];
                + [invocation setArgument:&bool_value atIndex:2];
                + [invocation invoke];
                + }
                + } else {
                + [search_.Get() setPlaceholderString:@""];
                }
                }


                To view, visit change 610501. To unsubscribe, or for help writing mail filters, visit settings.

                Gerrit-Project: chromium/src
                Gerrit-Branch: master
                Gerrit-MessageType: merged
                Gerrit-Change-Id: I0da791fa3510d682731c5d64971ac669a7608d5a
                Gerrit-Change-Number: 610501
                Gerrit-PatchSet: 3
                Gerrit-Owner: Eric Lawrence <elaw...@chromium.org>
                Gerrit-Reviewer: Commit Bot <commi...@chromium.org>
                Gerrit-Reviewer: Eric Lawrence <elaw...@chromium.org>
                Gerrit-Reviewer: Erik Chen <erik...@chromium.org>
                Gerrit-Reviewer: Keishi Hattori <kei...@chromium.org>
                Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
                Gerrit-Reviewer: Robert Sesek <rse...@chromium.org>
                Reply all
                Reply to author
                Forward
                0 new messages