Closed Bug 1394959 Opened 7 years ago Closed 6 years ago

Find API - don't wrap rectData with rectsAndText

Categories

(WebExtensions :: General, enhancement, P5)

enhancement

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
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.
(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.
(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.
Priority: -- → P5
Whiteboard: [find]
Product: Toolkit → WebExtensions
I'm not convinced we need to do anything here.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
Flags: needinfo?(mixedpuppy)
You need to log in before you can comment on or make changes to this bug.