Bug 147794 - Web Inspector: Simplify OS-specific CSS class names
Summary: Web Inspector: Simplify OS-specific CSS class names
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nikita Vasilyev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-07 14:20 PDT by Nikita Vasilyev
Modified: 2015-08-07 16:25 PDT (History)
8 users (show)

See Also:


Attachments
Patch (9.07 KB, patch)
2015-08-07 14:50 PDT, Nikita Vasilyev
timothy: review+
Details | Formatted Diff | Diff
Patch (8.18 KB, patch)
2015-08-07 15:29 PDT, Nikita Vasilyev
no flags Details | Formatted Diff | Diff
Patch (8.18 KB, patch)
2015-08-07 15:30 PDT, Nikita Vasilyev
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nikita Vasilyev 2015-08-07 14:20:45 PDT
We currently have 2 versions in our CSS:
— body:not(.el-capitan) for OS X <10.11
— body.el-capitan for OS X 10.11

There is a problem that 10.12, or anything >10.11 for that matter, currently gets "unknown-mac" class and falls into body:not(.el-capitan) selector. We don't want that; we want 10.12 to have El Capitan styles until we introduce a new version.

WebInspector.Platform.version.name is currently used to add a corresponding class name to <body>. We should do this instead:

    if (WebInspector.Platform.version.release <= 10)
        document.body.classList.add("legacy-mac");
    else if (WebInspector.Platform.version.release >= 11)
        document.body.classList.add("latest-mac");

CSS selectors:
— body.legacy-mac
— body.latest-mac

It will eliminate the need for :not() selector.

Later, when we need to have a new (third) UI version, we will:
— Keep .legacy-mac CSS rules unchanged
— Rename all .latest-mac to .el-capipan
— Write all new rules under .latest-mac prefix

via https://bugs.webkit.org/show_bug.cgi?id=147524#c8
Comment 1 Nikita Vasilyev 2015-08-07 14:50:25 PDT
Created attachment 258531 [details]
Patch
Comment 2 Timothy Hatcher 2015-08-07 15:01:57 PDT
Comment on attachment 258531 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=258531&action=review

> Source/WebInspectorUI/ChangeLog:28
> +        We currently have 2 versions in our CSS:
> +        - body:not(.el-capitan) for OS X <10.11
> +        - body.el-capitan for OS X 10.11
> +
> +        There is a problem that 10.12 (or >10.11, to be exact) currently gets
> +        "unknown-mac" class and falls into body:not(.el-capitan) selector. We don't want 
> +        that; we want 10.12 to have El Capitan styles until we introduce a new version.
> +
> +        WebInspector.Platform.version.name is currently used to add a corresponding class
> +        name to <body>. Instead we should use:
> +
> +        - .legacy-mac for OS X <10.11
> +        - .latest-mac for OS X >=10.11
> +
> +        It will eliminate the need for :not() selector.
> +
> +        Later, when we need to have a new (third) UI version, we will:
> +        - Keep .legacy-mac CSS rules unchanged
> +        - Rename all .latest-mac to .el-capitan
> +        - Write all new rules under .latest-mac prefix

Lets drop this.
Comment 3 Nikita Vasilyev 2015-08-07 15:29:34 PDT
Created attachment 258535 [details]
Patch
Comment 4 Nikita Vasilyev 2015-08-07 15:30:24 PDT
Created attachment 258536 [details]
Patch
Comment 5 WebKit Commit Bot 2015-08-07 16:25:54 PDT
Comment on attachment 258536 [details]
Patch

Clearing flags on attachment: 258536

Committed r188173: <http://trac.webkit.org/changeset/188173>
Comment 6 WebKit Commit Bot 2015-08-07 16:25:59 PDT
All reviewed patches have been landed.  Closing bug.