Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Issue 27750002: Add navigator.maxTouchPoints (Closed)

Created:
7 years, 2 months ago by Scott Blomquist (MS OPEN TECH)
Modified:
7 years, 2 months ago
CC:
blink-reviews, jamesr, dglazkov+blink, Inactive
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Patch Set 1 #

Total comments: 1

Patch Set 2 : Update tests; removed WebRuntimeFeatures. #

Patch Set 3 : Move Navigator properties out of navigator monolith #

Patch Set 4 : Remove spuriously introduced newline. #

Total comments: 1

Patch Set 5 : Add null checks; fix test failure #

Unified diffs Side-by-side diffs Delta from patch set Stats (+63 lines, -24 lines) Patch
M LayoutTests/fast/dom/navigator-detached-no-crash-expected.txt View 1 2 3 4 2 chunks +2 lines, -0 lines 0 comments Download
A LayoutTests/fast/dom/navigator-maxTouchPoints.html View 1 1 chunk +12 lines, -0 lines 0 comments Download
A + LayoutTests/fast/dom/navigator-maxTouchPoints-expected.txt View 1 1 chunk +2 lines, -3 lines 0 comments Download
M Source/core/core.gypi View 1 2 2 chunks +3 lines, -0 lines 0 comments Download
A + Source/core/events/NavigatorEvents.h View 1 2 1 chunk +8 lines, -6 lines 0 comments Download
A + Source/core/events/NavigatorEvents.cpp View 1 2 3 4 1 chunk +16 lines, -12 lines 0 comments Download
A + Source/core/events/NavigatorEvents.idl View 1 2 1 chunk +3 lines, -3 lines 0 comments Download
M Source/core/page/RuntimeEnabledFeatures.in View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M Source/core/page/Settings.in View 1 2 1 chunk +6 lines, -0 lines 0 comments Download
M Source/web/WebSettingsImpl.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M Source/web/WebSettingsImpl.cpp View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
M public/web/WebSettings.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 13 (0 generated)
Scott Blomquist (MS OPEN TECH)
7 years, 2 months ago (2013-10-17 20:46:18 UTC) #1
Inactive
https://codereview.chromium.org/27750002/diff/1/LayoutTests/fast/dom/navigator-maxTouchPoints.html File LayoutTests/fast/dom/navigator-maxTouchPoints.html (right): https://codereview.chromium.org/27750002/diff/1/LayoutTests/fast/dom/navigator-maxTouchPoints.html#newcode9 LayoutTests/fast/dom/navigator-maxTouchPoints.html:9: document.write("navigator.maxTouchPoints == 37: " + (navigator.maxTouchPoints == 37) + ...
7 years, 2 months ago (2013-10-17 21:03:42 UTC) #2
Scott Blomquist (MS OPEN TECH)
On 2013/10/17 21:03:42, Chris Dumez wrote: > https://codereview.chromium.org/27750002/diff/1/LayoutTests/fast/dom/navigator-maxTouchPoints.html#newcode9 > LayoutTests/fast/dom/navigator-maxTouchPoints.html:9: > document.write("navigator.maxTouchPoints == 37: " ...
7 years, 2 months ago (2013-10-17 23:03:00 UTC) #3
Rick Byers
Note this was originally reviewed here: https://codereview.chromium.org/20598008/ LGTM, thanks! +abarth for owners in Source/web
7 years, 2 months ago (2013-10-18 21:04:04 UTC) #4
abarth-chromium
Rather than adding this feature-specific code to the extremely general Navigator object, can you put ...
7 years, 2 months ago (2013-10-18 21:35:01 UTC) #5
abarth-chromium
On 2013/10/18 21:35:01, abarth wrote: > Rather than adding this feature-specific code to the extremely ...
7 years, 2 months ago (2013-10-18 21:37:41 UTC) #6
abarth-chromium
Notice that using a partial interface matches how this is specced: http://www.w3.org/TR/pointerevents/#extensions-to-the-navigator-interface
7 years, 2 months ago (2013-10-18 21:38:19 UTC) #7
Scott Blomquist (MS OPEN TECH)
On 2013/10/18 21:37:41, abarth wrote: > On 2013/10/18 21:35:01, abarth wrote: > > Rather than ...
7 years, 2 months ago (2013-10-19 00:03:39 UTC) #8
abarth-chromium
LGTM w/ missing null checks. Thanks for the CL! https://codereview.chromium.org/27750002/diff/101001/Source/core/events/NavigatorEvents.cpp File Source/core/events/NavigatorEvents.cpp (right): https://codereview.chromium.org/27750002/diff/101001/Source/core/events/NavigatorEvents.cpp#newcode43 Source/core/events/NavigatorEvents.cpp:43: ...
7 years, 2 months ago (2013-10-19 00:08:47 UTC) #9
sblom
On 2013/10/19 00:08:47, abarth wrote: > https://codereview.chromium.org/27750002/diff/101001/Source/core/events/NavigatorEvents.cpp#newcode43 > Source/core/events/NavigatorEvents.cpp:43: return > navigator->frame()->page()->settings().maxTouchPoints(); > You need ...
7 years, 2 months ago (2013-10-21 19:29:43 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sblom@microsoft.com/27750002/151001
7 years, 2 months ago (2013-10-21 22:45:51 UTC) #11
commit-bot: I haz the power
Change committed as 160153
7 years, 2 months ago (2013-10-22 08:43:39 UTC) #12
abarth-chromium
7 years, 2 months ago (2013-10-22 18:23:50 UTC) #13
Message was sent while issue was closed.
On 2013/10/21 19:29:43, sblom wrote:
> On 2013/10/19 00:08:47, abarth wrote:
> >
>
https://codereview.chromium.org/27750002/diff/101001/Source/core/events/Navig...
> > Source/core/events/NavigatorEvents.cpp:43: return
> > navigator->frame()->page()->settings().maxTouchPoints();
> > You need to null-check both frame() and page() on this line.
> 
> Done.
> 
> Under what circumstances are they null? If it's possible for them to be null
> under normal circumstances, I'll have to put more thought into the return
values
> when I abort due to null values.

Some objects have relatively normal C++ object lifetimes (e.g., they're owned by
another object and get deleted at a defined time).  For other objects, we use
the V8 garbage collector to decide when to delete them.  In most code in Blink,
that boundary occurs at the Frame.  The Frame's lifetime is controlled by the
embedder and it dies at a defined time.  Objects "below" Frame, such as Document
and (in this case) Navigator have lifetimes controlled by V8 garbage collector.

To answer your question, the frame() points is null when the Navigator has
outlived the frame.  For example, if script in one frame grabs the navigator
property from a child frame and then removes that child frame from its DOM.  The
Frame object dies (at that defined time) but the Navigator object lives as long
as the script holds a reference to it.

The page() property is null for a brief period of time during Frame cleanup.  We
first detach the Frame from the Page (but nulling out the pointers going in both
directions), and then we start tearing down the Frame's objects, eventually
ending with deleting the Frame object itself.

Powered by Google App Engine
This is Rietveld 408576698