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

Issue 2775663008: LayoutObject::absoluteBoundingBoxRectForRange() should take EphemeralRange (Closed)

Created:
3 years, 9 months ago by tanvir
Modified:
3 years, 7 months ago
CC:
chromium-reviews
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

LayoutObject::absoluteBoundingBoxRectForRange() should take EphemeralRange Currently LayoutObject::absoluteBoundingBoxRectForRange uses Range object to calculate textQuads. It should use EphemeralRange, as Layoutobject are owned by DOM. This Bug is divided into two parts. 1) This current CL will introduce textQuads taking EphemeralRange as input in VisibleUnit. 2) Other CL will make LayoutObject::absoluteBoundingBoxRectForRange() to take EphemeralRange BUG=691198

Patch Set 1 #

Total comments: 7

Patch Set 2 : Y #

Patch Set 3 : Y #

Total comments: 2

Patch Set 4 : Y #

Total comments: 21

Patch Set 5 : Y #

Patch Set 6 : Y #

Patch Set 7 : Review comments Addressed #

Total comments: 3

Patch Set 8 : Addressed Review comments #

Total comments: 7

Patch Set 9 : Split Patch:1(TextQuads at VisibleUnits) #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+106 lines, -1 line) Patch
M third_party/WebKit/Source/core/editing/VisibleUnits.h View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -0 lines 1 comment Download
M third_party/WebKit/Source/core/editing/VisibleUnits.cpp View 1 2 3 4 5 6 7 8 1 chunk +33 lines, -0 lines 1 comment Download
M third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp View 1 2 3 4 5 6 7 8 1 chunk +69 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutObject.cpp View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 72 (40 generated)
Srirama
Peer review looks good
3 years, 9 months ago (2017-03-24 13:26:59 UTC) #3
tanvir
PTAL!!! Thanks
3 years, 9 months ago (2017-03-24 13:45:35 UTC) #6
Xiaocheng
yosin@: As we proceed, we are having more and more identical functions in Range and ...
3 years, 9 months ago (2017-03-24 18:19:26 UTC) #7
yoichio
https://codereview.chromium.org/2775663008/diff/1/third_party/WebKit/Source/core/editing/EphemeralRange.cpp File third_party/WebKit/Source/core/editing/EphemeralRange.cpp (right): https://codereview.chromium.org/2775663008/diff/1/third_party/WebKit/Source/core/editing/EphemeralRange.cpp#newcode152 third_party/WebKit/Source/core/editing/EphemeralRange.cpp:152: void EphemeralRangeTemplate<Strategy>::textQuads( We want EphemeralRange to be independent from ...
3 years, 9 months ago (2017-03-27 05:24:46 UTC) #9
yosin_UTC9
https://codereview.chromium.org/2775663008/diff/1/third_party/WebKit/Source/core/editing/EphemeralRange.cpp File third_party/WebKit/Source/core/editing/EphemeralRange.cpp (right): https://codereview.chromium.org/2775663008/diff/1/third_party/WebKit/Source/core/editing/EphemeralRange.cpp#newcode160 third_party/WebKit/Source/core/editing/EphemeralRange.cpp:160: LayoutObject* r = node.layoutObject(); Please avoid to use one ...
3 years, 9 months ago (2017-03-27 05:43:14 UTC) #10
Shanmuga Pandi
https://codereview.chromium.org/2775663008/diff/40001/third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp File third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp (right): https://codereview.chromium.org/2775663008/diff/40001/third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp#newcode2061 third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp:2061: EXPECT_EQ(quadsStartToThree[0].toString(), quadsStartToTwo[0].toString()); toString() may not needed here https://codereview.chromium.org/2775663008/diff/40001/third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp#newcode2095 third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp:2095: ...
3 years, 8 months ago (2017-03-28 12:02:41 UTC) #11
tanvir
PTAL!! Thanks. https://codereview.chromium.org/2775663008/diff/1/third_party/WebKit/Source/core/editing/EphemeralRange.cpp File third_party/WebKit/Source/core/editing/EphemeralRange.cpp (right): https://codereview.chromium.org/2775663008/diff/1/third_party/WebKit/Source/core/editing/EphemeralRange.cpp#newcode152 third_party/WebKit/Source/core/editing/EphemeralRange.cpp:152: void EphemeralRangeTemplate<Strategy>::textQuads( On 2017/03/24 18:19:26, Xiaocheng wrote: ...
3 years, 8 months ago (2017-03-28 13:39:08 UTC) #12
Xiaocheng
https://codereview.chromium.org/2775663008/diff/60001/third_party/WebKit/Source/core/editing/VisibleUnits.cpp File third_party/WebKit/Source/core/editing/VisibleUnits.cpp (right): https://codereview.chromium.org/2775663008/diff/60001/third_party/WebKit/Source/core/editing/VisibleUnits.cpp#newcode4008 third_party/WebKit/Source/core/editing/VisibleUnits.cpp:4008: void textQuads(Vector<FloatQuad>& quad, nit: Please make this function |static| ...
3 years, 8 months ago (2017-03-28 21:29:34 UTC) #13
yoichio
I prefer splitting this patch more: Patch 1: Introducing VisibleUnit::textQuads and use it in LayoutObject::absoluteBoundingBoxRectForRange(Range). ...
3 years, 8 months ago (2017-03-29 01:51:07 UTC) #14
yoichio
https://codereview.chromium.org/2775663008/diff/60001/third_party/WebKit/Source/core/layout/LayoutObject.h File third_party/WebKit/Source/core/layout/LayoutObject.h (right): https://codereview.chromium.org/2775663008/diff/60001/third_party/WebKit/Source/core/layout/LayoutObject.h#newcode33 third_party/WebKit/Source/core/layout/LayoutObject.h:33: #include "core/editing/EphemeralRange.h" Could you declare |class EphemeralRange;| instead of ...
3 years, 8 months ago (2017-03-29 01:51:16 UTC) #15
yoichio
Could you run "git cl try" before requesting review? https://dev.chromium.org/developers/testing/try-server-usage
3 years, 8 months ago (2017-03-29 01:52:33 UTC) #16
Xiaocheng
https://codereview.chromium.org/2775663008/diff/60001/third_party/WebKit/Source/core/layout/LayoutObject.h File third_party/WebKit/Source/core/layout/LayoutObject.h (right): https://codereview.chromium.org/2775663008/diff/60001/third_party/WebKit/Source/core/layout/LayoutObject.h#newcode33 third_party/WebKit/Source/core/layout/LayoutObject.h:33: #include "core/editing/EphemeralRange.h" On 2017/03/29 at 01:51:15, yoichio wrote: > ...
3 years, 8 months ago (2017-03-29 02:16:03 UTC) #17
yosin_UTC9
https://codereview.chromium.org/2775663008/diff/60001/third_party/WebKit/Source/core/editing/VisibleUnits.cpp File third_party/WebKit/Source/core/editing/VisibleUnits.cpp (right): https://codereview.chromium.org/2775663008/diff/60001/third_party/WebKit/Source/core/editing/VisibleUnits.cpp#newcode4008 third_party/WebKit/Source/core/editing/VisibleUnits.cpp:4008: void textQuads(Vector<FloatQuad>& quad, Could you change this function at ...
3 years, 8 months ago (2017-03-29 02:31:40 UTC) #18
yoichio
I prefer adding "template <typename Strategy> class EphemeralRangeTemplate; using EphemeralRange = EphemeralRangeTemplate<EditingStrategy>;" in header because ...
3 years, 8 months ago (2017-03-29 06:16:17 UTC) #19
Xiaocheng
On 2017/03/29 at 06:16:17, yoichio wrote: > I prefer adding > "template <typename Strategy> class ...
3 years, 8 months ago (2017-03-29 20:08:38 UTC) #20
tanvir
On 2017/03/29 01:52:33, yoichio wrote: > Could you run "git cl try" before requesting review? ...
3 years, 8 months ago (2017-03-30 15:01:33 UTC) #37
Xiaocheng
https://codereview.chromium.org/2775663008/diff/120001/third_party/WebKit/Source/core/editing/VisibleUnits.cpp File third_party/WebKit/Source/core/editing/VisibleUnits.cpp (right): https://codereview.chromium.org/2775663008/diff/120001/third_party/WebKit/Source/core/editing/VisibleUnits.cpp#newcode4077 third_party/WebKit/Source/core/editing/VisibleUnits.cpp:4077: Vector<FloatQuad> textQuad(const EphemeralRange& range) { nit: s/textQuad/textQuads/ https://codereview.chromium.org/2775663008/diff/120001/third_party/WebKit/Source/core/editing/VisibleUnits.cpp#newcode4081 third_party/WebKit/Source/core/editing/VisibleUnits.cpp:4081: ...
3 years, 8 months ago (2017-03-30 18:46:19 UTC) #44
tanvir
https://codereview.chromium.org/2775663008/diff/60001/third_party/WebKit/Source/core/editing/VisibleUnits.cpp File third_party/WebKit/Source/core/editing/VisibleUnits.cpp (right): https://codereview.chromium.org/2775663008/diff/60001/third_party/WebKit/Source/core/editing/VisibleUnits.cpp#newcode4008 third_party/WebKit/Source/core/editing/VisibleUnits.cpp:4008: void textQuads(Vector<FloatQuad>& quad, On 2017/03/28 21:29:34, Xiaocheng wrote: > ...
3 years, 8 months ago (2017-03-30 19:11:06 UTC) #45
tanvir
In My Patch set 7, unit test for textQuads were failing after I rebased the ...
3 years, 8 months ago (2017-03-31 16:44:53 UTC) #56
tanvir
Latest patch, values for textQuads are coming different on different Mac windows and Linux and ...
3 years, 8 months ago (2017-03-31 17:45:30 UTC) #57
Xiaocheng
+kojii, +eae, +wanchang.ryu@lge.com https://codereview.chromium.org/2763013002 seems to be breaking the behavior. It makes LayoutText::absoluteQuadsForRange erase the ...
3 years, 8 months ago (2017-03-31 18:01:19 UTC) #59
Xiaocheng
3 years, 8 months ago (2017-03-31 18:01:42 UTC) #61
kojii
xiaochengh@, thank you for catching this! Would it be possible to land a failing test ...
3 years, 8 months ago (2017-04-03 03:48:04 UTC) #62
kojii
I think it's better to track in issue, filed http://crbug.com/707627
3 years, 8 months ago (2017-04-03 04:00:06 UTC) #63
tanvir
PTAL!!! I have divided this Bug into two parts 1) Introduce textQuads in VisibleUnits and ...
3 years, 8 months ago (2017-04-03 13:00:48 UTC) #65
Xiaocheng
lgtm. Please wait for the fix to crbug.com/707627 lands. Or if you don't want to ...
3 years, 8 months ago (2017-04-03 18:13:42 UTC) #66
eae
RS LGTM for core/layout/
3 years, 8 months ago (2017-04-03 22:38:30 UTC) #67
yosin_UTC9
https://codereview.chromium.org/2775663008/diff/160001/third_party/WebKit/Source/core/editing/VisibleUnits.cpp File third_party/WebKit/Source/core/editing/VisibleUnits.cpp (right): https://codereview.chromium.org/2775663008/diff/160001/third_party/WebKit/Source/core/editing/VisibleUnits.cpp#newcode4052 third_party/WebKit/Source/core/editing/VisibleUnits.cpp:4052: static void textQuadAlgorithm(Vector<FloatQuad>* quads, Please change |Range::textQuads()| instead of ...
3 years, 8 months ago (2017-04-04 01:25:22 UTC) #68
tanvir
On 2017/04/04 01:25:22, yosin_UTC9 wrote: > https://codereview.chromium.org/2775663008/diff/160001/third_party/WebKit/Source/core/editing/VisibleUnits.cpp > File third_party/WebKit/Source/core/editing/VisibleUnits.cpp (right): > > https://codereview.chromium.org/2775663008/diff/160001/third_party/WebKit/Source/core/editing/VisibleUnits.cpp#newcode4052 > ...
3 years, 8 months ago (2017-04-04 04:28:18 UTC) #69
tanvir
On 2017/04/04 04:28:18, tanvir wrote: > On 2017/04/04 01:25:22, yosin_UTC9 wrote: > > > https://codereview.chromium.org/2775663008/diff/160001/third_party/WebKit/Source/core/editing/VisibleUnits.cpp ...
3 years, 8 months ago (2017-04-04 04:35:48 UTC) #70
yosin_UTC9
I would like to have two patches: Patch 0: (optional) Get rid of useSelectionHeight from ...
3 years, 8 months ago (2017-04-04 05:17:49 UTC) #71
tanvir
3 years, 8 months ago (2017-04-04 06:29:10 UTC) #72
On 2017/04/04 05:17:49, yosin_UTC9 wrote:
> I would like to have two patches:
> 
> Patch 0: (optional) Get rid of useSelectionHeight from Range::textQuads() and
> |LayoutText::absoluteQuadsForRange|.
> It seems it is always false.
> We can do later.
> 
> Patch 1: Make Range::textQuads() to use function computeTextQuads()
> Note: we don't need to have useSelectionHeight since all call sites pass
false.
> Actually, there is
> only one call site, though.
> 
> 1-1 Introduce computeTextQuads(), with TODO to move "VisibleUnits.cpp" which
> takes as file local function in Range.cpp at current implementation, having
> function declaration in "VisibleUnits.h"
> 
> 1-2 Make Range::textQuads() to call it.
> 
> void Range::textQuads(Vector<FloatQuqad&>& quads, bool useSelectionHeight) {
>   quads = std::move(computeTextQuads(EphemeralRange(this),
useSelectionHeight);
> }
> 
> Patch 2-A: Make LayoutObject::absoluteBoundingBoxRectForRange() to take
> EphemeralRange
> 
> FloatRect LayoutObject::absoluteBoundingBoxRectForRange(const EphemralRange&
> range) {
>   const Vector<FloatQuad> quads = computeTextQuads(range, false);
>   ...
> }
> 
> TextFinder::find() {
>   ...
> enclosingIntRect(LayoutObject::absoluteBoundingBoxRectForRange(
>                 EphemeralRange(m_activeMatch.get())
>  ...
> }
> 
> int TextFinder::selectFindMatch(...) {
> ...
>  IntRect activeMatchBoundingBox = enclosingIntRect(
>      
>
LayoutObject::absoluteBoundingBoxRectForRange(EphemeralRange(m_activeMatch.get())));
> 
>  ...
> }
> 
> Patch 2-B: Move computeTextQuads() to "VisibleUnit.cpp"
> 
> 
> 2-A and 2-B can be parallel.
> 
> Please see patch[1], which makes |Range::boundingBox()| to work with
> EphemeralRange.
> 
> 
> [1] http://crrev.com/2776103002: updateMarkerRenderedRect() should use
> EphemeralRange

Thanks. I will work in this way then.
I will be Out Of Office till 16th of April, and I will continue working on this
Bug after i come back.
Thank you.

Powered by Google App Engine
This is Rietveld 408576698