Bug 63037 - Make instantiation of legacy editing position more explicit
Summary: Make instantiation of legacy editing position more explicit
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords:
Depends on:
Blocks: 52099 63040
  Show dependency treegraph
 
Reported: 2011-06-20 19:42 PDT by Ryosuke Niwa
Modified: 2011-06-22 09:45 PDT (History)
10 users (show)

See Also:


Attachments
cleanup; likely to fail build on various ports (24.98 KB, patch)
2011-06-20 21:02 PDT, Ryosuke Niwa
no flags Details | Formatted Diff | Diff
createDeprecatedLegacyEditingPosition to createLegacyEditingPosition; fixed gtk build (25.40 KB, patch)
2011-06-21 09:57 PDT, Ryosuke Niwa
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2011-06-20 19:42:42 PDT
Instead of keeping old constructor, we should make the way to instantiate a legacy editing position more explicit so that people will pay more attention to the deprecated code.
Comment 1 Ryosuke Niwa 2011-06-20 19:43:12 PDT
This step is also necessary to add a new Position constructor that takes Text* and offset.
Comment 2 Ryosuke Niwa 2011-06-20 21:02:53 PDT
Created attachment 97924 [details]
cleanup; likely to fail build on various ports
Comment 3 Martin Robinson 2011-06-20 21:35:01 PDT
Comment on attachment 97924 [details]
cleanup; likely to fail build on various ports

Attachment 97924 [details] did not pass gtk-ews (gtk):
Output: http://queues.webkit.org/results/8909844
Comment 4 Ryosuke Niwa 2011-06-20 22:40:18 PDT
(In reply to comment #3)
> (From update of attachment 97924 [details])
> Attachment 97924 [details] did not pass gtk-ews (gtk):
> Output: http://queues.webkit.org/results/8909844

http://trac.webkit.org/browser/trunk/Source/WebCore/accessibility/gtk/AXObjectCacheAtk.cpp:
Range::create(node->document(),  Position(node->parentNode(), 0), Position(node, 0));

This is terrible :(
Comment 5 Eric Seidel (no email) 2011-06-20 22:44:06 PDT
Comment on attachment 97924 [details]
cleanup; likely to fail build on various ports

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

> Source/WebCore/dom/Position.cpp:272
> +            return createDeprecatedLegacyEditingPosition(n, uncheckedPreviousOffsetForBackwardDeletion(n, o));

Huh?  Why not just createLegacyEditingPosition?  The deprecated seems redundant here.
Comment 6 Ryosuke Niwa 2011-06-20 22:47:48 PDT
(In reply to comment #5)
> (From update of attachment 97924 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=97924&action=review
> 
> > Source/WebCore/dom/Position.cpp:272
> > +            return createDeprecatedLegacyEditingPosition(n, uncheckedPreviousOffsetForBackwardDeletion(n, o));
> 
> Huh?  Why not just createLegacyEditingPosition?  The deprecated seems redundant here.

Sure. I can do that.
Comment 7 Darin Adler 2011-06-21 09:02:55 PDT
Comment on attachment 97924 [details]
cleanup; likely to fail build on various ports

Looks like the only failure EWS found is:

dom/Position.h: In member function ‘void WebCore::AXObjectCache::nodeTextChangePlatformNotification(WebCore::AccessibilityObject*, WebCore::AXObjectCache::AXTextChange, unsigned int, unsigned int)’:
dom/Position.h:73:9: error: ‘WebCore::Position::LegacyEditingOffset::LegacyEditingOffset(int)’ is private
accessibility/gtk/AXObjectCacheAtk.cpp:190:90: error: within this context
dom/Position.h:73:9: error: ‘WebCore::Position::LegacyEditingOffset::LegacyEditingOffset(int)’ is private
accessibility/gtk/AXObjectCacheAtk.cpp:190:109: error: within this context
Comment 8 Ryosuke Niwa 2011-06-21 09:07:09 PDT
(In reply to comment #7)
> (From update of attachment 97924 [details])
> Looks like the only failure EWS found is:
> 
> dom/Position.h: In member function ‘void WebCore::AXObjectCache::nodeTextChangePlatformNotification(WebCore::AccessibilityObject*, WebCore::AXObjectCache::AXTextChange, unsigned int, unsigned int)’:
> dom/Position.h:73:9: error: ‘WebCore::Position::LegacyEditingOffset::LegacyEditingOffset(int)’ is private
> accessibility/gtk/AXObjectCacheAtk.cpp:190:90: error: within this context
> dom/Position.h:73:9: error: ‘WebCore::Position::LegacyEditingOffset::LegacyEditingOffset(int)’ is private
> accessibility/gtk/AXObjectCacheAtk.cpp:190:109: error: within this context

Right. See comment #4. AXObjectCacheAtk.cpp is instantiating a Range with two legacy editing positions.
Comment 9 Ryosuke Niwa 2011-06-21 09:57:55 PDT
Created attachment 98002 [details]
createDeprecatedLegacyEditingPosition to createLegacyEditingPosition; fixed gtk build
Comment 10 Ryosuke Niwa 2011-06-22 08:52:54 PDT
Ping reviewers
Comment 11 Darin Adler 2011-06-22 09:33:26 PDT
Comment on attachment 98002 [details]
createDeprecatedLegacyEditingPosition to createLegacyEditingPosition; fixed gtk build

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

> Source/WebCore/dom/Position.h:70
> +        int value() { return m_offset; }

Maybe make this const?

> Source/WebCore/dom/Position.h:73
> +        LegacyEditingOffset(int offset) : m_offset(offset) { }

Maybe make this explicit too?
Comment 12 Ryosuke Niwa 2011-06-22 09:35:24 PDT
Thanks for the review.

(In reply to comment #11)
> (From update of attachment 98002 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=98002&action=review
> 
> > Source/WebCore/dom/Position.h:70
> > +        int value() { return m_offset; }
> 
> Maybe make this const?
> 
> > Source/WebCore/dom/Position.h:73
> > +        LegacyEditingOffset(int offset) : m_offset(offset) { }
> 
> Maybe make this explicit too?

Will fix.
Comment 13 Ryosuke Niwa 2011-06-22 09:45:52 PDT
Committed r89440: <http://trac.webkit.org/changeset/89440>