New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 826106 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Last visit 15 days ago
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Task



Sign in to add a comment

ApplyStyleCommand should utilize EphemeralRange

Project Member Reported by yosin@chromium.org, Mar 27 2018

Issue description

To catch a bug at call sites, we should make
|ApplyStyleCommand::UpdateStartEnd()| to take |EphemeralRange| instead of
two positions, start and end.


 
Owner: tanvir.r...@samsung.com
I am taking this up.

Comment 2 by yosin@chromium.org, Apr 3 2018

Summary: ApplyStyleCommand should utilize EphemeralRange (was: ApplyStyleCommand::UpdateStartEnd() should take EphemeralRange)
In addition to utilize EphemeralRange in UpdateStartEnd(), we want to utilize
EphemeralRange in
- Create(Document& document, 
         const EditingStyle* style,
         const Position& start,
         const Position& end)
 and it's wrappers.
- ApplyStyleCommand(Document&,
                    const EditingStyle*,
                    const Position& start,
                    const Position& end);

  void RemoveInlineStyle(EditingStyle*,
                         const Position& start,
                         const Position& end,
                         EditingState*);

  void FixRangeAndApplyInlineStyle(EditingStyle*,
                                   const Position& start,
                                   const Position& end,
                                   EditingState*);

and more functions to take |Position start, Position end|.

Comment 3 by yosin@chromium.org, Apr 3 2018

We may want to use |range_| instead of |start_| and |end_|.
If we can use |EpehemralRange|, it is nice.
Project Member

Comment 4 by bugdroid1@chromium.org, Apr 3 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5eeed90f5c798b2b3294e19e7646a5c338aed517

commit 5eeed90f5c798b2b3294e19e7646a5c338aed517
Author: tanvir.rizvi <tanvir.rizvi@samsung.com>
Date: Tue Apr 03 11:18:14 2018

Make ApplyStyleCommand::UpdateStartEnd to take EphemeralRange

UpdateStartEnd takes start and end position as parameters,
and then does a DCHECK_LE for start and end.
EphemeralRange constructor also does same DCHECK.
Since UpdateStartEnd is called from many places,
so to catch a bug at the call site, function
UpdateStartEnd is made to take EphemeralRange
instead.

Bug: 826106
Change-Id: I6e1cd23e9aac2846a2f083cd6f4d8110fa3a9085
Reviewed-on: https://chromium-review.googlesource.com/989852
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Tanvir Rizvi <tanvir.rizvi@samsung.com>
Cr-Commit-Position: refs/heads/master@{#547668}
[modify] https://crrev.com/5eeed90f5c798b2b3294e19e7646a5c338aed517/third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.cpp
[modify] https://crrev.com/5eeed90f5c798b2b3294e19e7646a5c338aed517/third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.h

Project Member

Comment 5 by bugdroid1@chromium.org, Apr 10 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f8554ddf85336ebf6b733022fa2b5fd23dc22065

commit f8554ddf85336ebf6b733022fa2b5fd23dc22065
Author: tanvir.rizvi <tanvir.rizvi@samsung.com>
Date: Tue Apr 10 09:16:59 2018

Use EphemeralRange in ApplyStyleCommand::RemoveInlineStyle

For code health we use Ephemeral range instead of
passsing position in RemoveInlineStyle.
With this we catch a bug at call sites,
as EphemeralRange construction takes care of the
current DCHECKS in RemoveInlineStyle

Bug: 826106
Change-Id: Ibaa37789f7671aa464b4c87d30f12bd023a67a3d
Reviewed-on: https://chromium-review.googlesource.com/1001437
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Tanvir Rizvi <tanvir.rizvi@samsung.com>
Cr-Commit-Position: refs/heads/master@{#549466}
[modify] https://crrev.com/f8554ddf85336ebf6b733022fa2b5fd23dc22065/third_party/blink/renderer/core/editing/commands/apply_style_command.cc
[modify] https://crrev.com/f8554ddf85336ebf6b733022fa2b5fd23dc22065/third_party/blink/renderer/core/editing/commands/apply_style_command.h

Status: Assigned (was: Available)

Sign in to add a comment