Closed
Bug 1394959
Opened 7 years ago
Closed 6 years ago
Find API - don't wrap rectData with rectsAndText
Categories
(WebExtensions :: General, enhancement, P5)
WebExtensions
General
Tracking
(Not tracked)
RESOLVED
WONTFIX
People
(Reporter: ntim, Unassigned)
References
Details
(Whiteboard: [find])
Right now:
rectData looks like this:
rectData: {
rectsAndTexts: {
rect: [...],
text: [...],
}
}
I'm not sure wrapping rect, text with rectsAndTexts is useful here, given that there's nothing else in the object.
In case we do want to add more things in the object, then I do think the name "rectsAndTexts" could be improved
Reporter | ||
Updated•7 years ago
|
Flags: needinfo?(mixedpuppy)
(In reply to Tim Nguyen :ntim from comment #0)
> Right now:
>
> rectData looks like this:
>
> rectData: {
> rectsAndTexts: {
> rect: [...],
> text: [...],
> }
> }
>
> I'm not sure wrapping rect, text with rectsAndTexts is useful here, given
> that there's nothing else in the object.
>
> In case we do want to add more things in the object, then I do think the
> name "rectsAndTexts" could be improved
rectsAndTexts is unique in that these arrays are aligned and have a special relationship with each other. I feel it is something that shouldn't be messed with and should be kept as it is.
Reporter | ||
Comment 2•7 years ago
|
||
(In reply to Kevin Jones from comment #1)
> rectsAndTexts is unique in that these arrays are aligned and have a special
> relationship with each other. I feel it is something that shouldn't be
> messed with and should be kept as it is.
If we want to link the 2 together, we can:
- return a Map object
- return only one Array with: [{ rect: ..., text: ...}, etc.]
(In reply to Tim Nguyen :ntim from comment #2)
> (In reply to Kevin Jones from comment #1)
> > rectsAndTexts is unique in that these arrays are aligned and have a special
> > relationship with each other. I feel it is something that shouldn't be
> > messed with and should be kept as it is.
>
> If we want to link the 2 together, we can:
> - return a Map object
> - return only one Array with: [{ rect: ..., text: ...}, etc.]
rectsAndTexts is conveniently passed directly from FinderHighlighter.jsm._getRangeRectsAndTexts():
http://searchfox.org/mozilla-central/source/toolkit/components/extensions/FindContent.jsm#182-183
rectsAndTexts is used in the same construct in FinderHighlighter.jsm. Why add the extra code?
I am not understanding why there is an issue being made with any of this.
Reporter | ||
Comment 4•7 years ago
|
||
(In reply to Kevin Jones from comment #3)
> I am not understanding why there is an issue being made with any of this.
The API should be easy to understand no matter what the internal implementation is.
The link between the two should be easy to understand.
Updated•7 years ago
|
Priority: -- → P5
Whiteboard: [find]
Updated•6 years ago
|
Product: Toolkit → WebExtensions
Comment 5•6 years ago
|
||
I'm not convinced we need to do anything here.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
Updated•6 years ago
|
Flags: needinfo?(mixedpuppy)
You need to log in
before you can comment on or make changes to this bug.
Description
•