Bug 193314 - Support parsing of additional values for the touch-action property
Summary: Support parsing of additional values for the touch-action property
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Antoine Quint
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-01-10 05:58 PST by Antoine Quint
Modified: 2019-01-15 00:31 PST (History)
5 users (show)

See Also:


Attachments
Patch (20.04 KB, patch)
2019-01-10 06:02 PST, Antoine Quint
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews126 for ios-simulator-wk2 (9.27 MB, application/zip)
2019-01-10 08:18 PST, EWS Watchlist
no flags Details
Patch (32.49 KB, patch)
2019-01-11 13:27 PST, Antoine Quint
no flags Details | Formatted Diff | Diff
Patch (31.07 KB, patch)
2019-01-11 13:49 PST, Antoine Quint
dino: review+
ews-watchlist: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews124 for ios-simulator-wk2 (2.54 MB, application/zip)
2019-01-11 16:00 PST, EWS Watchlist
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Antoine Quint 2019-01-10 05:58:05 PST
Support additional values for the touch-action property
Comment 1 Antoine Quint 2019-01-10 06:02:04 PST
Created attachment 358788 [details]
Patch
Comment 2 Radar WebKit Bug Importer 2019-01-10 06:10:03 PST
<rdar://problem/47176519>
Comment 3 EWS Watchlist 2019-01-10 08:18:00 PST
Comment on attachment 358788 [details]
Patch

Attachment 358788 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: https://webkit-queues.webkit.org/results/10697353

New failing tests:
imported/w3c/web-platform-tests/webrtc/simplecall.https.html
Comment 4 EWS Watchlist 2019-01-10 08:18:05 PST
Created attachment 358795 [details]
Archive of layout-test-results from ews126 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews126  Port: ios-simulator-wk2  Platform: Mac OS X 10.13.6
Comment 5 Dean Jackson 2019-01-10 13:36:39 PST
Comment on attachment 358788 [details]
Patch

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

> Source/WebCore/css/StyleBuilderConverter.h:1359
> +            auto& primitiveValue = downcast<CSSPrimitiveValue>(currentValue.get());

Is this always safe?

> Source/WebCore/css/StyleBuilderConverter.h:1361
> +            if (primitiveValueID != CSSValuePanX && primitiveValueID != CSSValuePanY && primitiveValueID != CSSValuePinchZoom)

So "none pan-x" evaluates to be "none" (initial)?

> Source/WebCore/css/parser/CSSPropertyParser.cpp:1349
> +    RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();

auto?

> Source/WebCore/css/parser/CSSPropertyParser.cpp:1351
> +        RefPtr<CSSPrimitiveValue> ident = consumeIdent<CSSValuePanX, CSSValuePanY, CSSValuePinchZoom>(range);

auto?

> Source/WebCore/dom/Element.cpp:106
> +#include "TouchAction.h"

Is it used in this file?

> Source/WebCore/platform/TouchAction.h:2
> + * Copyright (C) 2018 Apple Inc. All rights reserved.

2019.

> Source/WebCore/platform/TouchAction.h:17
> + * This library is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Library General Public
> + * License as published by the Free Software Foundation; either
> + * version 2 of the License, or (at your option) any later version.
> + *
> + * This library is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> + * Library General Public License for more details.
> + *
> + * You should have received a copy of the GNU Library General Public License
> + * along with this library; see the file COPYING.LIB.  If not, write to
> + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
> + * Boston, MA 02110-1301, USA.

Why are you using the GPL? Use the normal license.

> Source/WebCore/rendering/style/RenderStyle.h:1227
> +    void setTouchAction(OptionSet<TouchAction> ta) { SET_VAR(m_rareNonInheritedData, touchAction, ta.toRaw()); }

ugh. why not use "touchAction" rather than "ta"?

(or "touchActions")
Comment 6 Antoine Quint 2019-01-11 06:37:07 PST
(In reply to Dean Jackson from comment #5)
> Comment on attachment 358788 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=358788&action=review
> 
> > Source/WebCore/css/StyleBuilderConverter.h:1359
> > +            auto& primitiveValue = downcast<CSSPrimitiveValue>(currentValue.get());
> 
> Is this always safe?

Antti (on IRC) thinks so since we create the value list in consumeTouchAction(). 

> > Source/WebCore/css/StyleBuilderConverter.h:1361
> > +            if (primitiveValueID != CSSValuePanX && primitiveValueID != CSSValuePanY && primitiveValueID != CSSValuePinchZoom)
> 
> So "none pan-x" evaluates to be "none" (initial)?

It should evaluate to "auto", the initial value.

> > Source/WebCore/css/parser/CSSPropertyParser.cpp:1349
> > +    RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
> 
> auto?

Will update.

> > Source/WebCore/css/parser/CSSPropertyParser.cpp:1351
> > +        RefPtr<CSSPrimitiveValue> ident = consumeIdent<CSSValuePanX, CSSValuePanY, CSSValuePinchZoom>(range);
> 
> auto?

Will update.

> > Source/WebCore/dom/Element.cpp:106
> > +#include "TouchAction.h"
> 
> Is it used in this file?

Yes, in Element::allowsDoubleTapGesture(). Since TouchAction now is specified in a separate file, I figured it would be better to explicitly include it.

> > Source/WebCore/platform/TouchAction.h:2
> > + * Copyright (C) 2018 Apple Inc. All rights reserved.
> 
> 2019.

Will update.

> > Source/WebCore/platform/TouchAction.h:17
> > + * This library is free software; you can redistribute it and/or
> > + * modify it under the terms of the GNU Library General Public
> > + * License as published by the Free Software Foundation; either
> > + * version 2 of the License, or (at your option) any later version.
> > + *
> > + * This library is distributed in the hope that it will be useful,
> > + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> > + * Library General Public License for more details.
> > + *
> > + * You should have received a copy of the GNU Library General Public License
> > + * along with this library; see the file COPYING.LIB.  If not, write to
> > + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
> > + * Boston, MA 02110-1301, USA.
> 
> Why are you using the GPL? Use the normal license.

Copy/pasted from the wrong file without thinking twice.

> > Source/WebCore/rendering/style/RenderStyle.h:1227
> > +    void setTouchAction(OptionSet<TouchAction> ta) { SET_VAR(m_rareNonInheritedData, touchAction, ta.toRaw()); }
> 
> ugh. why not use "touchAction" rather than "ta"?
> 
> (or "touchActions")

Will update.
Comment 7 Antti Koivisto 2019-01-11 07:49:27 PST
You might also consider renaming all OptionSet<TouchAction> functions/fields/variables 'touchAction' -> 'touchActions' (unless you really want to match the property name exactly).
Comment 8 Antoine Quint 2019-01-11 09:20:07 PST
(In reply to Antti Koivisto from comment #7)
> You might also consider renaming all OptionSet<TouchAction>
> functions/fields/variables 'touchAction' -> 'touchActions' (unless you
> really want to match the property name exactly).

I will do that, I think that's the right thing to do.
Comment 9 Antoine Quint 2019-01-11 13:27:29 PST
Created attachment 358935 [details]
Patch
Comment 10 Antoine Quint 2019-01-11 13:49:27 PST
Created attachment 358937 [details]
Patch
Comment 11 Dean Jackson 2019-01-11 13:51:32 PST
Comment on attachment 358937 [details]
Patch

rs=me
Comment 12 EWS Watchlist 2019-01-11 16:00:25 PST
Comment on attachment 358937 [details]
Patch

Attachment 358937 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: https://webkit-queues.webkit.org/results/10718323

New failing tests:
css3/touch-action/touch-action-parsing.html
imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-illegal.html
imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_touch-action-verification.html
css3/touch-action/touch-action-computed-style.html
imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-verification.html
Comment 13 EWS Watchlist 2019-01-11 16:00:27 PST
Created attachment 358958 [details]
Archive of layout-test-results from ews124 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews124  Port: ios-simulator-wk2  Platform: Mac OS X 10.13.6
Comment 14 Antoine Quint 2019-01-15 00:31:02 PST
Committed r239978: <https://trac.webkit.org/changeset/239978>