Bug 147794

Summary: Web Inspector: Simplify OS-specific CSS class names
Product: WebKit Reporter: Nikita Vasilyev <nvasilyev>
Component: Web InspectorAssignee: Nikita Vasilyev <nvasilyev>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, commit-queue, graouts, joepeck, mattbaker, nvasilyev, timothy, webkit-bug-importer
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
timothy: review+
Patch
none
Patch none

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.