WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
REOPENED
153085
AX: Add a boundary value to AXTextStateChangeType
https://bugs.webkit.org/show_bug.cgi?id=153085
Summary
AX: Add a boundary value to AXTextStateChangeType
Doug Russell
Reported
2016-01-13 16:43:27 PST
Right now selection notifications for accessibility are only posted if selection actually changes, but it is often useful for assistive tech to be able to be to detect user attempts to change selection, even if they fail. Specifically a notification type (boundary) that can tell us when a user attempted to navigate past the boundary of an editable field is useful for providing feedback, for example bonking.
Attachments
Patch
(15.26 KB, patch)
2016-01-13 17:57 PST
,
Doug Russell
no flags
Details
Formatted Diff
Diff
Patch
(17.65 KB, patch)
2016-01-13 20:25 PST
,
Doug Russell
no flags
Details
Formatted Diff
Diff
Archive of layout-test-results from ews100 for mac-yosemite
(739.85 KB, application/zip)
2016-01-13 21:23 PST
,
Build Bot
no flags
Details
Archive of layout-test-results from ews106 for mac-yosemite-wk2
(799.84 KB, application/zip)
2016-01-13 21:27 PST
,
Build Bot
no flags
Details
Archive of layout-test-results from ews113 for mac-yosemite
(804.61 KB, application/zip)
2016-01-13 21:34 PST
,
Build Bot
no flags
Details
Patch
(19.16 KB, patch)
2016-01-14 07:26 PST
,
Doug Russell
no flags
Details
Formatted Diff
Diff
Archive of layout-test-results from ews101 for mac-yosemite
(914.28 KB, application/zip)
2016-01-14 08:24 PST
,
Build Bot
no flags
Details
Archive of layout-test-results from ews105 for mac-yosemite-wk2
(787.00 KB, application/zip)
2016-01-14 08:27 PST
,
Build Bot
no flags
Details
Archive of layout-test-results from ews114 for mac-yosemite
(827.71 KB, application/zip)
2016-01-14 08:30 PST
,
Build Bot
no flags
Details
Patch
(19.01 KB, patch)
2016-01-14 09:34 PST
,
Doug Russell
no flags
Details
Formatted Diff
Diff
Patch
(19.46 KB, patch)
2016-01-14 14:36 PST
,
Doug Russell
no flags
Details
Formatted Diff
Diff
Patch
(20.88 KB, patch)
2016-01-15 11:31 PST
,
Doug Russell
no flags
Details
Formatted Diff
Diff
Archive of layout-test-results from ews101 for mac-yosemite
(885.46 KB, application/zip)
2016-01-15 12:30 PST
,
Build Bot
no flags
Details
Archive of layout-test-results from ews116 for mac-yosemite
(830.03 KB, application/zip)
2016-01-15 12:33 PST
,
Build Bot
no flags
Details
Patch
(21.34 KB, patch)
2016-01-15 12:44 PST
,
Doug Russell
no flags
Details
Formatted Diff
Diff
Patch
(54.07 KB, patch)
2016-01-25 01:53 PST
,
Doug Russell
no flags
Details
Formatted Diff
Diff
Patch
(72.80 KB, patch)
2016-01-25 21:03 PST
,
Doug Russell
no flags
Details
Formatted Diff
Diff
patch.patch
(51.62 KB, patch)
2016-01-25 21:34 PST
,
Doug Russell
no flags
Details
Formatted Diff
Diff
patch
(78.82 KB, patch)
2016-01-26 02:04 PST
,
Doug Russell
no flags
Details
Formatted Diff
Diff
patch
(79.44 KB, patch)
2016-01-26 02:16 PST
,
Doug Russell
no flags
Details
Formatted Diff
Diff
Archive of layout-test-results from ews114 for mac-yosemite
(584.41 KB, application/zip)
2016-01-26 03:03 PST
,
Build Bot
no flags
Details
Archive of layout-test-results from ews100 for mac-yosemite
(852.74 KB, application/zip)
2016-01-26 03:07 PST
,
Build Bot
no flags
Details
Archive of layout-test-results from ews104 for mac-yosemite-wk2
(549.87 KB, application/zip)
2016-01-26 03:09 PST
,
Build Bot
no flags
Details
Patch
(54.07 KB, patch)
2016-01-26 11:42 PST
,
Doug Russell
no flags
Details
Formatted Diff
Diff
Patch
(54.72 KB, patch)
2016-01-31 16:30 PST
,
Doug Russell
no flags
Details
Formatted Diff
Diff
Patch
(100.47 KB, patch)
2016-02-03 14:53 PST
,
Doug Russell
no flags
Details
Formatted Diff
Diff
Show Obsolete
(26)
View All
Add attachment
proposed patch, testcase, etc.
Doug Russell
Comment 1
2016-01-13 17:57:44 PST
Created
attachment 268927
[details]
Patch
Doug Russell
Comment 2
2016-01-13 20:25:55 PST
Created
attachment 268932
[details]
Patch
Build Bot
Comment 3
2016-01-13 21:23:51 PST
Comment on
attachment 268932
[details]
Patch
Attachment 268932
[details]
did not pass mac-ews (mac): Output:
http://webkit-queues.webkit.org/results/688811
New failing tests: accessibility/mac/selection-boundary-userinfo.html
Build Bot
Comment 4
2016-01-13 21:23:53 PST
Created
attachment 268936
[details]
Archive of layout-test-results from ews100 for mac-yosemite The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews100 Port: mac-yosemite Platform: Mac OS X 10.10.5
Build Bot
Comment 5
2016-01-13 21:27:31 PST
Comment on
attachment 268932
[details]
Patch
Attachment 268932
[details]
did not pass mac-wk2-ews (mac-wk2): Output:
http://webkit-queues.webkit.org/results/688818
New failing tests: accessibility/mac/selection-boundary-userinfo.html
Build Bot
Comment 6
2016-01-13 21:27:33 PST
Created
attachment 268937
[details]
Archive of layout-test-results from ews106 for mac-yosemite-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews106 Port: mac-yosemite-wk2 Platform: Mac OS X 10.10.5
Build Bot
Comment 7
2016-01-13 21:33:58 PST
Comment on
attachment 268932
[details]
Patch
Attachment 268932
[details]
did not pass mac-debug-ews (mac): Output:
http://webkit-queues.webkit.org/results/688834
New failing tests: accessibility/mac/selection-boundary-userinfo.html
Build Bot
Comment 8
2016-01-13 21:34:00 PST
Created
attachment 268938
[details]
Archive of layout-test-results from ews113 for mac-yosemite The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews113 Port: mac-yosemite Platform: Mac OS X 10.10.5
Doug Russell
Comment 9
2016-01-14 07:26:53 PST
Created
attachment 268961
[details]
Patch
Build Bot
Comment 10
2016-01-14 08:24:04 PST
Comment on
attachment 268961
[details]
Patch
Attachment 268961
[details]
did not pass mac-ews (mac): Output:
http://webkit-queues.webkit.org/results/690593
New failing tests: editing/pasteboard/paste-list-001.html editing/style/block-style-006.html editing/style/block-style-005.html fast/spatial-navigation/snav-input.html
Build Bot
Comment 11
2016-01-14 08:24:07 PST
Created
attachment 268969
[details]
Archive of layout-test-results from ews101 for mac-yosemite The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews101 Port: mac-yosemite Platform: Mac OS X 10.10.5
Build Bot
Comment 12
2016-01-14 08:27:17 PST
Comment on
attachment 268961
[details]
Patch
Attachment 268961
[details]
did not pass mac-wk2-ews (mac-wk2): Output:
http://webkit-queues.webkit.org/results/690598
New failing tests: editing/style/block-style-006.html editing/style/block-style-005.html editing/pasteboard/paste-list-001.html
Build Bot
Comment 13
2016-01-14 08:27:19 PST
Created
attachment 268970
[details]
Archive of layout-test-results from ews105 for mac-yosemite-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews105 Port: mac-yosemite-wk2 Platform: Mac OS X 10.10.5
Build Bot
Comment 14
2016-01-14 08:30:44 PST
Comment on
attachment 268961
[details]
Patch
Attachment 268961
[details]
did not pass mac-debug-ews (mac): Output:
http://webkit-queues.webkit.org/results/690591
New failing tests: editing/pasteboard/paste-list-001.html editing/style/block-style-006.html editing/style/block-style-005.html fast/spatial-navigation/snav-input.html
Build Bot
Comment 15
2016-01-14 08:30:47 PST
Created
attachment 268972
[details]
Archive of layout-test-results from ews114 for mac-yosemite The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews114 Port: mac-yosemite Platform: Mac OS X 10.10.5
Doug Russell
Comment 16
2016-01-14 09:34:16 PST
Created
attachment 268976
[details]
Patch
Radar WebKit Bug Importer
Comment 17
2016-01-14 11:30:02 PST
<
rdar://problem/24191675
>
Doug Russell
Comment 18
2016-01-14 14:36:27 PST
Created
attachment 269010
[details]
Patch
chris fleizach
Comment 19
2016-01-14 17:37:54 PST
Comment on
attachment 269010
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=269010&action=review
> Source/WebCore/ChangeLog:9 > + an editable elements boundaries.
elements -> element's
> Source/WebCore/accessibility/mac/AXObjectCacheMac.mm:385 > + [userInfo setObject:[NSNumber numberWithBool:intent.selection.focusChange] forKey:NSAccessibilityTextSelectionChangedFocus];
@(intent.selectin.focusChange)
> Source/WebCore/editing/FrameSelection.cpp:1110 > + // FIXME: BIDI
do you have a WK bug to reference
> Source/WebCore/editing/FrameSelection.cpp:1164 > + return (AXTextSelection) { intentDirection, intentGranularity, false };
is the cast necessary (it may very well be, but i'm curious)
> Source/WebCore/editing/VisiblePosition.h:57 > + , m_isBoundary(false)
m_isBoundary should be false by default. you may not need to initialize
> Source/WebCore/editing/VisiblePosition.h:60 > + VisiblePosition(bool boundary) : m_affinity(VP_DEFAULT_AFFINITY), m_isBoundary(boundary) { };
should this be "bool boundary = false" so you get the default behavior without changing code to be no? or should we make a static boundaryVisiblePosition() class method that returns the right object i know people don't generally like passing around bools where the value is not clear what its for
> LayoutTests/accessibility/mac/selection-boundary-userinfo.html:8 > +<div role="textbox" tabindex=0 id="textbox" contenteditable=true>
can you also add a test with a input type="text"
> LayoutTests/accessibility/mac/selection-boundary-userinfo.html:30 > + shouldBe("results[0]", "AXTextStateChangeTypeSelectionMove");
looks like this file has some tabs in it
Doug Russell
Comment 20
2016-01-14 17:45:17 PST
(In reply to
comment #19
)
> Comment on
attachment 269010
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=269010&action=review
> > > Source/WebCore/ChangeLog:9 > > + an editable elements boundaries. > > elements -> element's
will do
> > > Source/WebCore/accessibility/mac/AXObjectCacheMac.mm:385 > > + [userInfo setObject:[NSNumber numberWithBool:intent.selection.focusChange] forKey:NSAccessibilityTextSelectionChangedFocus]; > > @(intent.selectin.focusChange)
will do
> > > Source/WebCore/editing/FrameSelection.cpp:1110 > > + // FIXME: BIDI > > do you have a WK bug to reference
I'll file one
> > > Source/WebCore/editing/FrameSelection.cpp:1164 > > + return (AXTextSelection) { intentDirection, intentGranularity, false }; > > is the cast necessary (it may very well be, but i'm curious)
This syntax was suggested by Darin in past reviews, I'll see if the cast can be dropped
> > > Source/WebCore/editing/VisiblePosition.h:57 > > + , m_isBoundary(false) > > m_isBoundary should be false by default. you may not need to initialize
That is how I had it, trying this way to see if that's what was tripping up the windows build (it's one of the bigger things I changed between patches when windows stopped building)
> > > Source/WebCore/editing/VisiblePosition.h:60 > > + VisiblePosition(bool boundary) : m_affinity(VP_DEFAULT_AFFINITY), m_isBoundary(boundary) { }; > > should this be "bool boundary = false" so you get the default behavior > without changing code to be no? > or should we make a static boundaryVisiblePosition() class method that > returns the right object
If you want boundary to be false you can just call VisiblePosition(). I can do a static if you prefer but it feels odd to not use a constructor.
> > i know people don't generally like passing around bools where the value is > not clear what its for
And we'd solve that with the static method?
> > > LayoutTests/accessibility/mac/selection-boundary-userinfo.html:8 > > +<div role="textbox" tabindex=0 id="textbox" contenteditable=true> > > can you also add a test with a input type="text"
Yup. As is this patch doesn't post a boundary notification when arrowing up in a input (since they're single line controls), but I can file an enhancement for that.
> > > LayoutTests/accessibility/mac/selection-boundary-userinfo.html:30 > > + shouldBe("results[0]", "AXTextStateChangeTypeSelectionMove"); > > looks like this file has some tabs in it
I'll fix that.
chris fleizach
Comment 21
2016-01-14 17:55:40 PST
Comment on
attachment 269010
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=269010&action=review
>>> Source/WebCore/editing/VisiblePosition.h:60 >>> + VisiblePosition(bool boundary) : m_affinity(VP_DEFAULT_AFFINITY), m_isBoundary(boundary) { }; >> >> should this be "bool boundary = false" so you get the default behavior without changing code to be no? >> or should we make a static boundaryVisiblePosition() class method that returns the right object >> >> i know people don't generally like passing around bools where the value is not clear what its for > > If you want boundary to be false you can just call VisiblePosition(). I can do a static if you prefer but it feels odd to not use a constructor.
In this case no one would ever use VisiblePosition(false) because that's already exists, so it also feels weird to have a constructor with a parameter when it's not a necessary parameter that's what I was thinking a static VisiblePosition visibleBoundaryPosition(); might be more clear
Doug Russell
Comment 22
2016-01-15 11:31:26 PST
Created
attachment 269074
[details]
Patch
Build Bot
Comment 23
2016-01-15 12:30:19 PST
Comment on
attachment 269074
[details]
Patch
Attachment 269074
[details]
did not pass mac-ews (mac): Output:
http://webkit-queues.webkit.org/results/695263
New failing tests: accessibility/mac/selection-boundary-userinfo.html
Build Bot
Comment 24
2016-01-15 12:30:22 PST
Created
attachment 269083
[details]
Archive of layout-test-results from ews101 for mac-yosemite The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews101 Port: mac-yosemite Platform: Mac OS X 10.10.5
Build Bot
Comment 25
2016-01-15 12:33:46 PST
Comment on
attachment 269074
[details]
Patch
Attachment 269074
[details]
did not pass mac-debug-ews (mac): Output:
http://webkit-queues.webkit.org/results/695246
New failing tests: accessibility/mac/selection-boundary-userinfo.html
Build Bot
Comment 26
2016-01-15 12:33:48 PST
Created
attachment 269084
[details]
Archive of layout-test-results from ews116 for mac-yosemite The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews116 Port: mac-yosemite Platform: Mac OS X 10.10.5
Doug Russell
Comment 27
2016-01-15 12:44:16 PST
Created
attachment 269085
[details]
Patch
chris fleizach
Comment 28
2016-01-22 08:44:55 PST
are you still trying to resolve windows failure or is it unrelated
Darin Adler
Comment 29
2016-01-24 15:12:39 PST
Comment on
attachment 269085
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=269085&action=review
Generally looks good. I am concerned about this new VisiblePosition feature. Maybe this is the best way to do it, though. Did you consult with other WebKit editing code experts on the best way? Also need some help from a Windows expert on figuring out why Windows bot failed to build. review- because we at least want to make the "explicit" change and to get Windows building
> Source/WebCore/accessibility/mac/AXObjectCacheMac.mm:385 > + if (intent.selection.focusChange) > + [userInfo setObject:@(intent.selection.focusChange) forKey:NSAccessibilityTextSelectionChangedFocus];
Does moving this here fix a bug? If so, do is that fix covered by a test case?
> Source/WebCore/editing/FrameSelection.cpp:1110 > + // FIXME: BIDI
Would be nice to write a more specific FIXME. I think I know what you are driving at, but explicitly stating it is nicer for other programmers who show up later.
> Source/WebCore/editing/FrameSelection.cpp:1117 > + // FIXME: BIDI
Ditto.
> Source/WebCore/editing/FrameSelection.cpp:1130 > + case SentenceBoundary: // FIXME: Boundary should effect direction
Grammar error. We mean "should affect" not "should effect". Also should put a period; we use a sort of sentence style on these comments and call for a period.
> Source/WebCore/editing/FrameSelection.cpp:1137 > + case ParagraphBoundary: // FIXME: Boundary should effect direction
Ditto.
> Source/WebCore/editing/FrameSelection.cpp:1141 > + case DocumentBoundary: // FIXME: Boundary should effect direction
Ditto.
> Source/WebCore/editing/FrameSelection.cpp:1224 > + notifyAccessibilityForSelectionChange((AXTextStateChangeIntent) { AXTextStateChangeTypeSelectionBoundary, textSelectionWithDirectionAndGranularity(direction, granularity) });
Shouldn’t need parentheses around (AXTextStateChangeIntent). Maybe you did that to quiet the mistaken complaint from the style checker?
> Source/WebCore/editing/VisiblePosition.h:53 > + static VisiblePosition boundaryVisiblePosition();
I’m unclear on how this is intended to be used. We need a comment explaining this since it’s not an obvious concept.
> Source/WebCore/editing/VisiblePosition.h:116 > + VisiblePosition(bool boundary) : m_affinity(VP_DEFAULT_AFFINITY), m_isBoundary(boundary) { };
Should qualify this with "explicit" so code inside VisiblePosition can’t make the mistake of returning a boolean and have it automatically turned into a VisiblePosition.
> Source/WebCore/editing/VisiblePosition.h:125 > Position m_deepPosition; > EAffinity m_affinity; > + bool m_isBoundary = false;
I think it’s dangerous that now we have a type of VisiblePosition that won’t survive a round trop if broken into position and affinity and then made into a VIsiblePosition again. Do we have other options here rather than adding this state to VisiblePosition?
Doug Russell
Comment 30
2016-01-24 17:46:44 PST
(In reply to
comment #29
)
> Comment on
attachment 269085
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=269085&action=review
> > Generally looks good. I am concerned about this new VisiblePosition feature. > Maybe this is the best way to do it, though. Did you consult with other > WebKit editing code experts on the best way? > > Also need some help from a Windows expert on figuring out why Windows bot > failed to build. > > review- because we at least want to make the "explicit" change and to get > Windows building
I sent the patch to Brent Fulgham hoping for some help on this, but haven't heard back yet.
> > > Source/WebCore/accessibility/mac/AXObjectCacheMac.mm:385 > > + if (intent.selection.focusChange) > > + [userInfo setObject:@(intent.selection.focusChange) forKey:NSAccessibilityTextSelectionChangedFocus]; > > Does moving this here fix a bug? If so, do is that fix covered by a test > case?
There's not a known bug related to this, but I noticed that in it's previous location intent.selection.focusChange wasn't guaranteed to be initialized so I moved it up. I can submit it in it's own patch if you'd like me to.
> > > Source/WebCore/editing/FrameSelection.cpp:1110 > > + // FIXME: BIDI > > Would be nice to write a more specific FIXME. I think I know what you are > driving at, but explicitly stating it is nicer for other programmers who > show up later.
Will do.
> > > Source/WebCore/editing/FrameSelection.cpp:1117 > > + // FIXME: BIDI > > Ditto. > > > Source/WebCore/editing/FrameSelection.cpp:1130 > > + case SentenceBoundary: // FIXME: Boundary should effect direction > > Grammar error. We mean "should affect" not "should effect". Also should put > a period; we use a sort of sentence style on these comments and call for a > period.
Will do.
> > > Source/WebCore/editing/FrameSelection.cpp:1137 > > + case ParagraphBoundary: // FIXME: Boundary should effect direction > > Ditto. > > > Source/WebCore/editing/FrameSelection.cpp:1141 > > + case DocumentBoundary: // FIXME: Boundary should effect direction > > Ditto. > > > Source/WebCore/editing/FrameSelection.cpp:1224 > > + notifyAccessibilityForSelectionChange((AXTextStateChangeIntent) { AXTextStateChangeTypeSelectionBoundary, textSelectionWithDirectionAndGranularity(direction, granularity) }); > > Shouldn’t need parentheses around (AXTextStateChangeIntent). Maybe you did > that to quiet the mistaken complaint from the style checker?
I'll remove them.
> > > Source/WebCore/editing/VisiblePosition.h:53 > > + static VisiblePosition boundaryVisiblePosition(); > > I’m unclear on how this is intended to be used. We need a comment explaining > this since it’s not an obvious concept.
I'll add one.
> > > Source/WebCore/editing/VisiblePosition.h:116 > > + VisiblePosition(bool boundary) : m_affinity(VP_DEFAULT_AFFINITY), m_isBoundary(boundary) { }; > > Should qualify this with "explicit" so code inside VisiblePosition can’t > make the mistake of returning a boolean and have it automatically turned > into a VisiblePosition.
Will do.
> > > Source/WebCore/editing/VisiblePosition.h:125 > > Position m_deepPosition; > > EAffinity m_affinity; > > + bool m_isBoundary = false; > > I think it’s dangerous that now we have a type of VisiblePosition that won’t > survive a round trop if broken into position and affinity and then made into > a VIsiblePosition again. Do we have other options here rather than adding > this state to VisiblePosition?
We could thread error state through the modifyMovingX logic to return why the VisiblePosition it's returning is NULL. It would mean touching a lot more code though.
Doug Russell
Comment 31
2016-01-25 01:53:44 PST
Created
attachment 269731
[details]
Patch
Darin Adler
Comment 32
2016-01-25 09:27:10 PST
Comment on
attachment 269085
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=269085&action=review
>>> Source/WebCore/editing/VisiblePosition.h:125 >>> + bool m_isBoundary = false; >> >> I think it’s dangerous that now we have a type of VisiblePosition that won’t survive a round trop if broken into position and affinity and then made into a VIsiblePosition again. Do we have other options here rather than adding this state to VisiblePosition? > > We could thread error state through the modifyMovingX logic to return why the VisiblePosition it's returning is NULL. It would mean touching a lot more code though.
One way to do it would be to add a new type that’s either a VisiblePosition or a boundary, rather than adding it to the original VisiblePosition type. You would need to touch more code, but just to change the type from VisiblePosition to the new type. Even though it makes the patch bigger, I think that would likely be better than introducing this concept into all other code using VisiblePosition for any other purpose. Could start as simply as a struct with a boolean and a VisiblePosition in it.
Doug Russell
Comment 33
2016-01-25 11:54:37 PST
(In reply to
comment #32
)
> Comment on
attachment 269085
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=269085&action=review
> > >>> Source/WebCore/editing/VisiblePosition.h:125 > >>> + bool m_isBoundary = false; > >> > >> I think it’s dangerous that now we have a type of VisiblePosition that won’t survive a round trop if broken into position and affinity and then made into a VIsiblePosition again. Do we have other options here rather than adding this state to VisiblePosition? > > > > We could thread error state through the modifyMovingX logic to return why the VisiblePosition it's returning is NULL. It would mean touching a lot more code though. > > One way to do it would be to add a new type that’s either a VisiblePosition > or a boundary, rather than adding it to the original VisiblePosition type. > You would need to touch more code, but just to change the type from > VisiblePosition to the new type. Even though it makes the patch bigger, I > think that would likely be better than introducing this concept into all > other code using VisiblePosition for any other purpose. Could start as > simply as a struct with a boolean and a VisiblePosition in it.
My latest patch threads a bool * through all the relevant logic. If this works for you I'm happy with it, but I could take the above approach if that's preferable.
Doug Russell
Comment 34
2016-01-25 21:03:10 PST
Created
attachment 269847
[details]
Patch
Doug Russell
Comment 35
2016-01-25 21:34:28 PST
Created
attachment 269848
[details]
patch.patch Switching back to bool * approach. I'll hold onto the last patch as a possible improvement for the future.
Doug Russell
Comment 36
2016-01-25 21:38:18 PST
(In reply to
comment #35
)
> Created
attachment 269848
[details]
> patch.patch > > Switching back to bool * approach. I'll hold onto the last patch as a > possible improvement for the future.
Previous patch doesn't apply. I'll revisit this in the morning.
Doug Russell
Comment 37
2016-01-26 02:04:03 PST
Created
attachment 269870
[details]
patch Try to fix the GTK build failure
Doug Russell
Comment 38
2016-01-26 02:16:20 PST
Created
attachment 269871
[details]
patch try to fix GTK build
Build Bot
Comment 39
2016-01-26 03:03:50 PST
Comment on
attachment 269871
[details]
patch
Attachment 269871
[details]
did not pass mac-debug-ews (mac): Output:
http://webkit-queues.webkit.org/results/740612
Number of test failures exceeded the failure limit.
Build Bot
Comment 40
2016-01-26 03:03:54 PST
Created
attachment 269872
[details]
Archive of layout-test-results from ews114 for mac-yosemite The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews114 Port: mac-yosemite Platform: Mac OS X 10.10.5
Build Bot
Comment 41
2016-01-26 03:07:16 PST
Comment on
attachment 269871
[details]
patch
Attachment 269871
[details]
did not pass mac-ews (mac): Output:
http://webkit-queues.webkit.org/results/740633
Number of test failures exceeded the failure limit.
Build Bot
Comment 42
2016-01-26 03:07:19 PST
Created
attachment 269873
[details]
Archive of layout-test-results from ews100 for mac-yosemite The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews100 Port: mac-yosemite Platform: Mac OS X 10.10.5
Build Bot
Comment 43
2016-01-26 03:09:37 PST
Comment on
attachment 269871
[details]
patch
Attachment 269871
[details]
did not pass mac-wk2-ews (mac-wk2): Output:
http://webkit-queues.webkit.org/results/740636
Number of test failures exceeded the failure limit.
Build Bot
Comment 44
2016-01-26 03:09:40 PST
Created
attachment 269874
[details]
Archive of layout-test-results from ews104 for mac-yosemite-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews104 Port: mac-yosemite-wk2 Platform: Mac OS X 10.10.5
Doug Russell
Comment 45
2016-01-26 11:42:27 PST
Created
attachment 269895
[details]
Patch
Doug Russell
Comment 46
2016-01-26 11:43:22 PST
Changing the return type had more knock on effects than I'm prepared to take on with this patch, so I'm sticking with the bool * approach.
Darin Adler
Comment 47
2016-01-30 13:36:36 PST
Comment on
attachment 269895
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=269895&action=review
Looks good. Some style issues. When we use pointers for out arguments like this, normally we set the value of out arguments in all cases, rather than relying on them being initialized on entry. That means there are more places here we would need to set *reachedBoundary to false.
> Source/WebCore/editing/FrameSelection.cpp:763 > +VisiblePosition FrameSelection::modifyMovingRight(TextGranularity granularity, bool * reachedBoundary)
WebKit coding style would use bool* rather than bool * with a space. I’m surprised you chose the out argument over the "VisiblePosition plus a bool" struct option. Another possibility would be to use Optional<VisiblePosition> and have “no position at all” indicate a boundary. That’s distinct from a null VisiblePosition. But probably too subtle and confusing.
> Source/WebCore/editing/FrameSelection.cpp:796 > + case LineBoundary: { > + pos = rightBoundaryOfLine(startForPlatform(), directionOfEnclosingBlock(), reachedBoundary); > break; > + }
No braces in a case like this in WebKit coding style.
> Source/WebCore/editing/FrameSelection.cpp:804 > +VisiblePosition FrameSelection::modifyMovingForward(TextGranularity granularity, bool * reachedBoundary)
bool*
> Source/WebCore/editing/FrameSelection.cpp:1014 > + case LineBoundary: { > + pos = leftBoundaryOfLine(startForPlatform(), directionOfEnclosingBlock(), reachedBoundary); > break; > + }
No braces in a case like this in WebKit coding style.
> Source/WebCore/editing/FrameSelection.h:295 > + VisiblePosition modifyMovingRight(TextGranularity, bool * = nullptr); > + VisiblePosition modifyMovingForward(TextGranularity, bool * = nullptr);
Formatting should be bool* and when the argument meaning is not clear from the type alone, we require an argument name, so should be: bool* reachedBoundary = nullptr I’ll mention this only once, but the issue recurs many other times below.
> Source/WebCore/editing/VisiblePosition.cpp:67 > {
bool*
> Source/WebCore/editing/VisiblePosition.cpp:78 > +VisiblePosition VisiblePosition::previous(EditingBoundaryCrossingRule rule, bool * reachedBoundary) const
bool*
> Source/WebCore/editing/VisiblePosition.cpp:259 > +VisiblePosition VisiblePosition::left(bool stayInEditableContent, bool * reachedBoundary) const
bool* I’ll stop mentioning this, since it happens many more times.
Doug Russell
Comment 48
2016-01-31 16:30:27 PST
Created
attachment 270353
[details]
Patch
WebKit Commit Bot
Comment 49
2016-01-31 20:09:09 PST
Comment on
attachment 270353
[details]
Patch Clearing flags on attachment: 270353 Committed
r195949
: <
http://trac.webkit.org/changeset/195949
>
WebKit Commit Bot
Comment 50
2016-01-31 20:09:16 PST
All reviewed patches have been landed. Closing bug.
Doug Russell
Comment 51
2016-02-03 14:53:14 PST
Reopening to attach new patch.
Doug Russell
Comment 52
2016-02-03 14:53:17 PST
Created
attachment 270604
[details]
Patch
Doug Russell
Comment 53
2016-03-08 21:43:16 PST
Comment on
attachment 270604
[details]
Patch This shouldn't have been re-opened. I think this was a webkit-patch bug number typo.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug