Bug 204809 - Add disabled highlight API skeleton
Summary: Add disabled highlight API skeleton
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Megan Gardner
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-12-03 12:41 PST by Megan Gardner
Modified: 2019-12-03 21:48 PST (History)
22 users (show)

See Also:


Attachments
Patch (96.43 KB, patch)
2019-12-03 15:05 PST, Megan Gardner
no flags Details | Formatted Diff | Diff
Patch (45.03 KB, patch)
2019-12-03 16:55 PST, Megan Gardner
no flags Details | Formatted Diff | Diff
Patch (45.65 KB, patch)
2019-12-03 18:41 PST, Megan Gardner
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Megan Gardner 2019-12-03 12:41:01 PST
Add disabled highlight API skeleton
Comment 1 Megan Gardner 2019-12-03 15:05:11 PST
Created attachment 384762 [details]
Patch
Comment 2 Radar WebKit Bug Importer 2019-12-03 15:06:04 PST
<rdar://problem/57605049>
Comment 3 Tim Horton 2019-12-03 15:12:33 PST
Comment on attachment 384762 [details]
Patch

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

> Source/WebCore/Configurations/FeatureDefines.xcconfig:194
> +ENABLE_HIGHLIGHT_API_iphoneos = ENABLE_HIGHLIGHT_API;

Why not just ENABLE_HIGHLIGHT_API = ENABLE_HIGHLIGHT_API;? I don't think you need this to be platform-dependent, and certainly you don't want it to be off on watchOS/tvOS.
Comment 4 Ryosuke Niwa 2019-12-03 15:43:07 PST
Comment on attachment 384762 [details]
Patch

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

> Source/WebCore/Modules/highlight/HighlightMap.h:54
> +    ExceptionOr<void> setNamedItem(const String& name, const HighlightRangeGroup& value);
> +    bool deleteNamedProperty(const String& name);
> +    
> +    ExceptionOr<void> set(const String& name, const HighlightRangeGroup& value);

Do we really need both??

> Source/WebCore/Modules/highlight/HighlightMap.h:65
> +

Nit: blank line.

> Source/WebCore/Modules/highlight/HighlightMap.idl:35
> +    // FIXME: add any additional functionality as specified by the full spec

This comment seems unnecessary. We obviously need to do that but like any other DOM API.

> Source/WebCore/Modules/highlight/HighlightRangeGroup.h:59
> +        Ref<HighlightRangeGroup> m_group;
> +        size_t m_index { 0 }; // FIXME: There needs to be a mechanism to handle when ranges are added or removed from the middle of the HighlightRangeGroup.

This iterator probably needs to refer back to HighlightRangeGroup and iterate over the real list.

> Source/WebCore/Modules/highlight/HighlightRangeGroup.idl:32
> +    iterable<StaticRange>;  // TODO: should be setlike

Use FIXME instead.

> Source/WebCore/Modules/highlight/HighlightRangeGroup.idl:33
> +//    readonly attribute CSSStyleDeclaration style; // TODO: add inline style support

Ditto. Also, this is doubly commented out. Why not just : FIXME: Add readonly attribute CSSStyleDeclaration style?

> LayoutTests/highlight/highlight-interfaces.html:9
> +debug("\nTesting Highlight:");

Why \n at the beginning?
Comment 5 Wenson Hsieh 2019-12-03 16:01:17 PST
Comment on attachment 384762 [details]
Patch

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

> Source/WebCore/Modules/highlight/HighlightMap.idl:34
> +    [MayThrowException] void set (DOMString style, HighlightRangeGroup group);

Nit - extra space between set and (

> Source/WebCore/Modules/highlight/HighlightRangeGroup.cpp:64
> +    

Nit - extra newline.

> Source/WebCore/Modules/highlight/HighlightRangeGroup.h:65
> +

Nit - extra newline

> Source/WebCore/css/DOMCSSNamespace.idl:37
> +    [CallWith=Document] static readonly attribute HighlightMap highlights;

Does this need an EnabledAtRuntime too?
Comment 6 Megan Gardner 2019-12-03 16:55:24 PST
Created attachment 384768 [details]
Patch
Comment 7 Alex Christensen 2019-12-03 18:02:07 PST
Comment on attachment 384768 [details]
Patch

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

> Source/WebCore/Modules/highlight/HighlightMap.cpp:2
> +* Copyright (C) 2019 Apple Inc. All rights reserved.

There should be a space before the *
Same for a few files in this.

> Source/WebCore/Modules/highlight/HighlightMap.cpp:36
> +

extra space

> Source/WebCore/Modules/highlight/HighlightMap.cpp:49
> +

ditto

> Source/WebCore/Modules/highlight/HighlightRangeGroup.h:34
> +

ditto

> Source/WebKitLegacy/mac/WebView/WebView.mm:3135
> +    RuntimeEnabledFeatures::sharedFeatures().setHighlightAPIEnabled([preferences highlightAPIEnabled]);

Windows WebKitLegacy will be running these tests.  Do we want to skip all the tests or implement it on Windows?
Comment 8 Megan Gardner 2019-12-03 18:28:27 PST
Comment on attachment 384768 [details]
Patch

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

>> Source/WebKitLegacy/mac/WebView/WebView.mm:3135
>> +    RuntimeEnabledFeatures::sharedFeatures().setHighlightAPIEnabled([preferences highlightAPIEnabled]);
> 
> Windows WebKitLegacy will be running these tests.  Do we want to skip all the tests or implement it on Windows?

Is there much we need to do to implement on Windows? This is mostly work in WebCore.
Comment 9 Megan Gardner 2019-12-03 18:41:01 PST
Created attachment 384779 [details]
Patch
Comment 10 Ryosuke Niwa 2019-12-03 19:24:47 PST
Comment on attachment 384779 [details]
Patch

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

> Source/WebCore/Modules/highlight/HighlightRangeGroup.idl:31
> +    iterable<StaticRange>;  // FIXME: should be setlike

Use a single space?
Comment 11 WebKit Commit Bot 2019-12-03 21:48:54 PST
Comment on attachment 384779 [details]
Patch

Clearing flags on attachment: 384779

Committed r253093: <https://trac.webkit.org/changeset/253093>
Comment 12 WebKit Commit Bot 2019-12-03 21:48:56 PST
All reviewed patches have been landed.  Closing bug.