Changeset 212272 in webkit


Ignore:
Timestamp:
Feb 13, 2017 6:28:55 PM (7 years ago)
Author:
BJ Burg
Message:

Web Inspector: expose system user interface layout direction through InspectorFrontendHost
https://bugs.webkit.org/show_bug.cgi?id=168209
<rdar://problem/11573736>

Reviewed by Joseph Pecoraro.

Forward the UserInterfaceLayoutDirection of the inspector page. If the WebKit client has
properly set the UI directionality from system settings in PageClient, this will get inherited
automatically by the Inspector's WebPage instance.

Source/WebCore:

  • inspector/InspectorFrontendClient.h:
  • inspector/InspectorFrontendClientLocal.cpp:

(WebCore::InspectorFrontendClientLocal::userInterfaceLayoutDirection):

  • inspector/InspectorFrontendClientLocal.h:
  • inspector/InspectorFrontendHost.h:
  • inspector/InspectorFrontendHost.idl:
  • inspector/InspectorFrontendHost.cpp:

(WebCore::InspectorFrontendHost::userInterfaceLayoutDirection):
Expose the directionality to the frontend as "ltr" or "rtl" strings.

Source/WebKit2:

  • WebProcess/WebPage/RemoteWebInspectorUI.cpp:

(WebKit::RemoteWebInspectorUI::userInterfaceLayoutDirection):

  • WebProcess/WebPage/RemoteWebInspectorUI.h:
  • WebProcess/WebPage/WebInspectorUI.cpp:

(WebKit::WebInspectorUI::userInterfaceLayoutDirection):

  • WebProcess/WebPage/WebInspectorUI.h:
Location:
trunk/Source
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r212271 r212272  
     12017-02-12  Brian Burg  <bburg@apple.com>
     2
     3        Web Inspector: expose system user interface layout direction through InspectorFrontendHost
     4        https://bugs.webkit.org/show_bug.cgi?id=168209
     5        <rdar://problem/11573736>
     6
     7        Reviewed by Joseph Pecoraro.
     8
     9        Forward the UserInterfaceLayoutDirection of the inspector page. If the WebKit client has
     10        properly set the UI directionality from system settings in PageClient, this will get inherited
     11        automatically by the Inspector's WebPage instance.
     12
     13        * inspector/InspectorFrontendClient.h:
     14        * inspector/InspectorFrontendClientLocal.cpp:
     15        (WebCore::InspectorFrontendClientLocal::userInterfaceLayoutDirection):
     16        * inspector/InspectorFrontendClientLocal.h:
     17
     18        * inspector/InspectorFrontendHost.h:
     19        * inspector/InspectorFrontendHost.idl:
     20        * inspector/InspectorFrontendHost.cpp:
     21        (WebCore::InspectorFrontendHost::userInterfaceLayoutDirection):
     22        Expose the directionality to the frontend as "ltr" or "rtl" strings.
     23
    1242017-02-13  Zalan Bujtas  <zalan@apple.com>
    225
  • trunk/Source/WebCore/inspector/InspectorFrontendClient.h

    r205369 r212272  
    3131#pragma once
    3232
     33#include "UserInterfaceLayoutDirection.h"
    3334#include <wtf/Forward.h>
    3435#include <wtf/text/WTFString.h>
     
    6061    virtual void closeWindow() = 0;
    6162
     63    virtual UserInterfaceLayoutDirection userInterfaceLayoutDirection() const = 0;
     64
    6265    WEBCORE_EXPORT virtual void requestSetDockSide(DockSide) = 0;
    6366    WEBCORE_EXPORT virtual void changeAttachedWindowHeight(unsigned) = 0;
  • trunk/Source/WebCore/inspector/InspectorFrontendClientLocal.cpp

    r208742 r212272  
    170170}
    171171
     172UserInterfaceLayoutDirection InspectorFrontendClientLocal::userInterfaceLayoutDirection() const
     173{
     174    return m_frontendPage->userInterfaceLayoutDirection();
     175}
     176
    172177void InspectorFrontendClientLocal::requestSetDockSide(DockSide dockSide)
    173178{
  • trunk/Source/WebCore/inspector/InspectorFrontendClientLocal.h

    r204479 r212272  
    6565    WEBCORE_EXPORT void moveWindowBy(float x, float y) final;
    6666
     67    WEBCORE_EXPORT UserInterfaceLayoutDirection userInterfaceLayoutDirection() const final;
     68
    6769    WEBCORE_EXPORT void requestSetDockSide(DockSide) final;
    6870    WEBCORE_EXPORT void changeAttachedWindowHeight(unsigned) final;
  • trunk/Source/WebCore/inspector/InspectorFrontendHost.cpp

    r211033 r212272  
    11/*
    2  * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
     2 * Copyright (C) 2007-2017 Apple Inc. All rights reserved.
    33 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
    44 *
     
    197197}
    198198
     199String InspectorFrontendHost::userInterfaceLayoutDirection()
     200{
     201    if (m_client && m_client->userInterfaceLayoutDirection() == UserInterfaceLayoutDirection::RTL)
     202        return ASCIILiteral("rtl");
     203
     204    return ASCIILiteral("ltr");
     205}
     206
    199207void InspectorFrontendHost::setAttachedWindowHeight(unsigned height)
    200208{
  • trunk/Source/WebCore/inspector/InspectorFrontendHost.h

    r205369 r212272  
    11/*
    2  * Copyright (C) 2007 Apple Inc. All rights reserved.
     2 * Copyright (C) 2007-2017 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    6262    float zoomFactor();
    6363
     64    String userInterfaceLayoutDirection();
     65
    6466    void setAttachedWindowHeight(unsigned);
    6567    void setAttachedWindowWidth(unsigned);
  • trunk/Source/WebCore/inspector/InspectorFrontendHost.idl

    r205369 r212272  
    11/*
    2  * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
     2 * Copyright (C) 2007-2017 Apple Inc. All rights reserved.
    33 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
    44 * Copyright (C) 2009 Google Inc. All rights reserved.
     
    4343    float zoomFactor();
    4444
     45    DOMString userInterfaceLayoutDirection();
     46
    4547    void requestSetDockSide(DOMString side);
    4648
  • trunk/Source/WebInspectorUI/UserInterface/Base/InspectorFrontendHostStub.js

    r205424 r212272  
    6565        },
    6666
     67        userInterfaceLayoutDirection: function()
     68        {
     69            return "ltr";
     70        },
     71
    6772        requestSetDockSide: function(side)
    6873        {
  • trunk/Source/WebKit2/ChangeLog

    r212269 r212272  
     12017-02-12  Brian Burg  <bburg@apple.com>
     2
     3        Web Inspector: expose system user interface layout direction through InspectorFrontendHost
     4        https://bugs.webkit.org/show_bug.cgi?id=168209
     5        <rdar://problem/11573736>
     6
     7        Reviewed by Joseph Pecoraro.
     8
     9        Forward the UserInterfaceLayoutDirection of the inspector page. If the WebKit client has
     10        properly set the UI directionality from system settings in PageClient, this will get inherited
     11        automatically by the Inspector's WebPage instance.
     12
     13        * WebProcess/WebPage/RemoteWebInspectorUI.cpp:
     14        (WebKit::RemoteWebInspectorUI::userInterfaceLayoutDirection):
     15        * WebProcess/WebPage/RemoteWebInspectorUI.h:
     16        * WebProcess/WebPage/WebInspectorUI.cpp:
     17        (WebKit::WebInspectorUI::userInterfaceLayoutDirection):
     18        * WebProcess/WebPage/WebInspectorUI.h:
     19
    1202017-02-13  Youenn Fablet  <youennf@gmail.com>
    221
  • trunk/Source/WebKit2/WebProcess/WebPage/RemoteWebInspectorUI.cpp

    r211054 r212272  
    113113}
    114114
     115WebCore::UserInterfaceLayoutDirection RemoteWebInspectorUI::userInterfaceLayoutDirection() const
     116{
     117    return m_page.corePage()->userInterfaceLayoutDirection();
     118}
     119
    115120void RemoteWebInspectorUI::bringToFront()
    116121{
  • trunk/Source/WebKit2/WebProcess/WebPage/RemoteWebInspectorUI.h

    r205369 r212272  
    5959    String debuggableType() override { return m_debuggableType; }
    6060
     61    WebCore::UserInterfaceLayoutDirection userInterfaceLayoutDirection() const override;
     62
    6163    void bringToFront() override;
    6264    void closeWindow() override;
  • trunk/Source/WebKit2/WebProcess/WebPage/WebInspectorUI.cpp

    r201171 r212272  
    139139}
    140140
     141WebCore::UserInterfaceLayoutDirection WebInspectorUI::userInterfaceLayoutDirection() const
     142{
     143    return m_page.corePage()->userInterfaceLayoutDirection();
     144}
     145
    141146void WebInspectorUI::requestSetDockSide(DockSide side)
    142147{
  • trunk/Source/WebKit2/WebProcess/WebPage/WebInspectorUI.h

    r205403 r212272  
    9191    void closeWindow() override;
    9292
     93    WebCore::UserInterfaceLayoutDirection userInterfaceLayoutDirection() const override;
     94
    9395    void requestSetDockSide(DockSide) override;
    9496    void changeAttachedWindowHeight(unsigned) override;
Note: See TracChangeset for help on using the changeset viewer.