6a560ccfb218d22959c537fc66300868c4b99a0a: Bug 1286464 part.17 ContentEventHandler::OnQueryTextRect() should compute a line breaker's rect from the last text frame if the queried range starts with a block frame r?smaug draft
Masayuki Nakano <masayuki@d-toybox.com> - Mon, 08 Aug 2016 18:11:11 +0900 - rev 399846
Push 26007 by masayuki@d-toybox.com at Fri, 12 Aug 2016 06:30:02 +0000
Bug 1286464 part.17 ContentEventHandler::OnQueryTextRect() should compute a line breaker's rect from the last text frame if the queried range starts with a block frame r?smaug When queried range starts with a block frame, we cannot compute proper line breaker's rect at its open tag only with the frame's rect because the proper rect should be at the end of previous text frame. Therefore, this patch makes SetRangeFromFlatTextOffset() return the last text node found at scanning the range. Then, OnQueryTextRect() can compute the first line breaker's rect with it (if there is at least one text node). However, if the last text node is hidden by CSS or something, this patch won't work. We need to do something in another bug for hidden frame's issue, though. But note that IME typically doesn't request hidden text's rect because neither selection nor composition string is in such range. MozReview-Commit-ID: 2FFzNoubJ1y
efab9565c8fed755fbf253ee1d965fe9f2f20f52: Bug 1286464 part.16 Rename ContentEventHandler::Get*FrameHavingFlatTextInRange() to ContentEventHandler::Get*FrameInRangeForTextRect() and make them treat a moz-<br> element as a normal <br> element because it doesn't cause text but needs to compute text rect in the last empty line r=smaug draft
Masayuki Nakano <masayuki@d-toybox.com> - Tue, 02 Aug 2016 14:00:32 +0900 - rev 399845
Push 26007 by masayuki@d-toybox.com at Fri, 12 Aug 2016 06:30:02 +0000
Bug 1286464 part.16 Rename ContentEventHandler::Get*FrameHavingFlatTextInRange() to ContentEventHandler::Get*FrameInRangeForTextRect() and make them treat a moz-<br> element as a normal <br> element because it doesn't cause text but needs to compute text rect in the last empty line r=smaug In plain text editor, moz-<br> element is appended for a placeholder of empty line when the text ends with a line breaker. Therefore, when we compute text rects, we need to handle it same as a normal <br> element even though it doesn't cause any text. MozReview-Commit-ID: 4IXLafU6o0W
38dfe856f4ad7c91a3b14416525cdb23776382a0: Bug 1286464 part.15 Rewrite ContentEventHandler::OnQueryTextRect() with new utilities like ContentEventHandler::OnQueryTextRectArray() r?smaug draft
Masayuki Nakano <masayuki@d-toybox.com> - Fri, 12 Aug 2016 14:11:33 +0900 - rev 399844
Push 26007 by masayuki@d-toybox.com at Fri, 12 Aug 2016 06:30:02 +0000
Bug 1286464 part.15 Rewrite ContentEventHandler::OnQueryTextRect() with new utilities like ContentEventHandler::OnQueryTextRectArray() r?smaug Although, this patch is pretty big and complicated, but I have no idea to separate this since this rewrites all over the OnQueryTextRect() with new utility methods which are implemented for OnQueryTextRectArray(). Currently, OnQueryTextRect() doesn't support line breaks before block level elements. Therefore, in HTML editors, eQueryTextRect may not work fine if the range includes open tags of block level elements. This causes odd positioning of IME's candidate window in non-e10s mode. This implements ContentEventHandler::GetLastFrameHavingFlatTextInRange() which scans the given range from last to first. However, this hits wrong NS_ASSERTION() in nsContentIterator::Last(). mLast can be nullptr if there is no content but Init() returns NS_OK even in such case. I think that returning NS_OK is fine because it's not illegal case. Therefore this patch fixes the wrong assertion. MozReview-Commit-ID: E6OnIA1eMou
f06cb89db2d44619822f900980b174e63d44f81c: Bug 1286464 part.14 When ContentEventHandler::OnQueryTextRectArray() reaches the end of query range, it should append caret rect at the end of the content r=smaug draft
Masayuki Nakano <masayuki@d-toybox.com> - Fri, 05 Aug 2016 16:51:49 +0900 - rev 399843
Push 26007 by masayuki@d-toybox.com at Fri, 12 Aug 2016 06:30:02 +0000
Bug 1286464 part.14 When ContentEventHandler::OnQueryTextRectArray() reaches the end of query range, it should append caret rect at the end of the content r=smaug When the loop in ContentEventHandler::OnQueryTextRectArray() reaches at the end of contents, it should append a caret rect at the end of the contents. That helps deciding popup position of IME when caret is at the end of the contents. This patch guesses the caret rect with eQueryTextRect event (for avoiding the dependency of native caret position of eQueryCaretRect event handler). MozReview-Commit-ID: 8cGeHpkzX9g
5eb554497416ede4f41a3ee448d6e227620f663c: Bug 1286464 part.13 ContentEventHandler::OnQueryTextRectArray() should guess a line breaker's rect with previous character's rect if it's available r=smaug draft
Masayuki Nakano <masayuki@d-toybox.com> - Fri, 05 Aug 2016 14:31:37 +0900 - rev 399842
Push 26007 by masayuki@d-toybox.com at Fri, 12 Aug 2016 06:30:02 +0000
Bug 1286464 part.13 ContentEventHandler::OnQueryTextRectArray() should guess a line breaker's rect with previous character's rect if it's available r=smaug This is hack for returning better rect for a line breaker caused by non-<br> element. E.g., if a block frame causes a line break, after the last visible character is the best position, i.e., there is |<p>ABC</p><p>DEF</p>| and the caret is after "C", querying next character's rect should be computed with "C"'s rect, rather than computed with next <p> element's border rect. MozReview-Commit-ID: 7nXt74GGpNf
bfa36b7a7fa7228fdfa6b8e9a235a2b9be4b8d80: Bug 1286464 part.12 ContentEventHandler::GetFirstFrameHavingFlatTextInRange() should return only frames whose content causes text r=smaug draft
Masayuki Nakano <masayuki@d-toybox.com> - Thu, 21 Jul 2016 17:45:17 +0900 - rev 399841
Push 26007 by masayuki@d-toybox.com at Fri, 12 Aug 2016 06:30:02 +0000
Bug 1286464 part.12 ContentEventHandler::GetFirstFrameHavingFlatTextInRange() should return only frames whose content causes text r=smaug If it returns frames which don't cause text, the caller needs complicated loop. So, it should return only frames which causes some text. MozReview-Commit-ID: 9gny0w1PUMa
d301d6cc2e4273414f8f660a83c17fe912b4f82d: Bug 1286464 part.11 nsTextFrame::GetCharacterRectsInRange() shouldn't compute character rect at the first character in next nsTextFrame r=jfkthame draft
Masayuki Nakano <masayuki@d-toybox.com> - Thu, 21 Jul 2016 16:24:37 +0900 - rev 399840
Push 26007 by masayuki@d-toybox.com at Fri, 12 Aug 2016 06:30:02 +0000
Bug 1286464 part.11 nsTextFrame::GetCharacterRectsInRange() shouldn't compute character rect at the first character in next nsTextFrame r=jfkthame nsTextFrame::GetCharacterRectsInRange() handles a character at the end offset of its content as in it. However, it causes odd result when the caller wants first text rect in the next nsTextFrame. E.g., if end of query range is at the next nsTextFrame's first character, currently, it returns the last character as in same line. So, it should stop handling next frame's first character as in it. MozReview-Commit-ID: 7WteerisrZp
4c45980d158fd5dfb3eb5b9fa3145ff5b3dac278: Bug 1286464 part.10 ContentEventHandler::OnQueryTextRectArray() should append same rects for following characters of a line breaker in nsTextFrame r=smaug draft
Masayuki Nakano <masayuki@d-toybox.com> - Fri, 05 Aug 2016 14:06:30 +0900 - rev 399839
Push 26007 by masayuki@d-toybox.com at Fri, 12 Aug 2016 06:30:02 +0000
Bug 1286464 part.10 ContentEventHandler::OnQueryTextRectArray() should append same rects for following characters of a line breaker in nsTextFrame r=smaug If line breakers in a text node works as is, e.g., |white-space: pre;| is specified, we need to handle line breakers in text frames too. This patch handles "\n" in text nodes same as line breakers caused by some elements. MozReview-Commit-ID: JmXesusFxzR
6402a5e228b94633fea21c15773e40e4938b11b5: Bug 1286464 part.9 ContentEventHandler::OnQueryTextRectArray() shouldn't append same rect for following character of a lien breaker when the query range starts from middle of the line breaker r=smaug draft
Masayuki Nakano <masayuki@d-toybox.com> - Fri, 05 Aug 2016 13:53:08 +0900 - rev 399838
Push 26007 by masayuki@d-toybox.com at Fri, 12 Aug 2016 06:30:02 +0000
Bug 1286464 part.9 ContentEventHandler::OnQueryTextRectArray() shouldn't append same rect for following character of a lien breaker when the query range starts from middle of the line breaker r=smaug If the query range starts middle of a line breaker, i.e., "\r[\n", ContentEventHandler::OnQueryTextRectArray() does not need to (in other words, should not) append same rect anymore. This patch checks if the range starts middle of a line breaker and in such case, skip to append same rect. MozReview-Commit-ID: H5gdtAakGcP
a42f468b44eee3956324de6ec4a8b0acbbd5165d: Bug 1286464 part.8 ContentEventHandler::OnQueryTextRectArray() should handle line break before a node r=smaug draft
Masayuki Nakano <masayuki@d-toybox.com> - Fri, 05 Aug 2016 13:36:22 +0900 - rev 399837
Push 26007 by masayuki@d-toybox.com at Fri, 12 Aug 2016 06:30:02 +0000
Bug 1286464 part.8 ContentEventHandler::OnQueryTextRectArray() should handle line break before a node r=smaug Some elements causes a line break before itself. In such case, OnQueryTextRectArray() should append one or two rects for such line breakers. This patch also implements GetLineBreakerRectBefore(). It computes line breaker rect for the given frame. Even if it's a <br> frame, we cannot use its rect because <br> frame height is computed with line height but we need text's height (i.e., font height) and both height and width are 0 if it's in quirks mode and in non-empty line. Therefore, this patch computes it with frame's baseline, font's max-ascent and max-descent. Although, this patch computes a line breaker rect caused by a open tag of a block level element with block frame's rect. However, it shouldn't be used actually as far as possible. Following patches will kill the path to the hack. MozReview-Commit-ID: 9cym04j9NH9
34cd75d05cc15c1b960eda0c3fe16387729ce14f: Bug 1286464 part.7 ContentEventHandler::OnQueryTextRect() should redirect the query event to OnQueryCaretRect() if its query range is empty r=smaug draft
Masayuki Nakano <masayuki@d-toybox.com> - Mon, 25 Jul 2016 23:19:53 +0900 - rev 399836
Push 26007 by masayuki@d-toybox.com at Fri, 12 Aug 2016 06:30:02 +0000
Bug 1286464 part.7 ContentEventHandler::OnQueryTextRect() should redirect the query event to OnQueryCaretRect() if its query range is empty r=smaug When eQueryTextRect's query range length is 0 (this may be caused by native IME's bug), it should return caret rect. Therefore, it should redirect such query events to OnQueryCaretRect(). Such IME must want caret rect in such case. MozReview-Commit-ID: JaUwhw1Cn5G
8767a8ffa18393cb5ad7fba0e9c636897fa5867f: Bug 1286464 part.6 ContentEventHandler::OnQueryCaretRect() should use eQueryTextRect event when it needs to guess the caret rect r=smaug draft
Masayuki Nakano <masayuki@d-toybox.com> - Fri, 29 Jul 2016 00:37:09 +0900 - rev 399835
Push 26007 by masayuki@d-toybox.com at Fri, 12 Aug 2016 06:30:02 +0000
Bug 1286464 part.6 ContentEventHandler::OnQueryCaretRect() should use eQueryTextRect event when it needs to guess the caret rect r=smaug ContentEventHandler::OnQueryTextRect() is now too complicated. So, we shouldn't duplicate similar code in OnQueryCaretRect(). When it needs to guess a caret rect from a character rect, we shouldn't compute character rect by itself. MozReview-Commit-ID: 5G4MzQJzmoV
97e07181367f9ba14136a0ad16b9573c8eba9658: Bug 1286464 part.5 Create ContentEventHandler::EnsureNonEmptyRect() for query various rect event handlers r=smaug draft
Masayuki Nakano <masayuki@d-toybox.com> - Fri, 05 Aug 2016 13:01:17 +0900 - rev 399834
Push 26007 by masayuki@d-toybox.com at Fri, 12 Aug 2016 06:30:02 +0000
Bug 1286464 part.5 Create ContentEventHandler::EnsureNonEmptyRect() for query various rect event handlers r=smaug This can kill the duplicated code in a lot of places in ContentEventHandler. MozReview-Commit-ID: BRpBkbXyeBs
3202c7863eb1d0d806ee08b62071cb1e569ace38: Bug 1286464 part.4 ContentEventHandler::SetRangeFromFlatTextOffset() should set end of the range to after a line break when the range is end between a set of native line breakers r=smaug draft
Masayuki Nakano <masayuki@d-toybox.com> - Thu, 28 Jul 2016 17:23:47 +0900 - rev 399833
Push 26007 by masayuki@d-toybox.com at Fri, 12 Aug 2016 06:30:02 +0000
Bug 1286464 part.4 ContentEventHandler::SetRangeFromFlatTextOffset() should set end of the range to after a line break when the range is end between a set of native line breakers r=smaug Currently, ContentEventHandler::SetRangeFromFlatTextOffset() sets end point to before a line breaker when the end of queried range is between a set of native line breakers (i.e., "\r]\n" on Windows). This causes unexpected empty range (e.g., "[]\n") when it queries a text rect at [\r]\n. Therefore, it should select an XP line breaker in such case (i.e., the range should be "[\n]" when it queries "[\r]\n" or "\r[\n]"). Note that we don't need to do anything at setting selection start because it's always aligned to before the line breaker. MozReview-Commit-ID: 6ht8QNAhibY
c037dbc573ea1e9f6fd92b2fd33b7135fb3e3ef6: Bug 1286464 part.3 Make static methods, AdjustTextRectNode() and GetFirstFrameInRange(), members of ContentEventHandler r=smaug draft
Masayuki Nakano <masayuki@d-toybox.com> - Fri, 05 Aug 2016 12:43:40 +0900 - rev 399832
Push 26007 by masayuki@d-toybox.com at Fri, 12 Aug 2016 06:30:02 +0000
Bug 1286464 part.3 Make static methods, AdjustTextRectNode() and GetFirstFrameInRange(), members of ContentEventHandler r=smaug This patch makes the static methods members of ContentEventHandler because ContentEventHandler::NodePosition is useful for them. * nsINode* AdjustTextRectNode(nsINode*, int32_t&) -> NodePosition GetNodeHavingFlatText(nsINode* int32_t) * nsIFrame* GetFirstFrameInRange(nsRange*, int32_t&) -> FrameAndNodeOffset GetFirstFrameHavingFlatTextInRange(nsRange*) So, this patch avoids unclear in/out arguments of them. MozReview-Commit-ID: 7yWeIkRdGj
8d29d282fb08403ee5906a5c42142b74924b47f4: Bug 1286464 part.2 GetFirstFrameInRange() should return node offset since it may return different node's frame r=m_kato draft
Masayuki Nakano <masayuki@d-toybox.com> - Thu, 14 Jul 2016 22:57:00 +0900 - rev 399831
Push 26007 by masayuki@d-toybox.com at Fri, 12 Aug 2016 06:30:02 +0000
Bug 1286464 part.2 GetFirstFrameInRange() should return node offset since it may return different node's frame r=m_kato GetFirstFrameInRange() uses AdjustTextRectNode() which may return different node before retrieving the result frame. Therefore, the caller may need offset in the new node. MozReview-Commit-ID: 2AQU5WfahT9
0463821ba70963199be2735fce079b7afa7e747f: Bug 1286464 part.1 Cleaning up ContentEventHandler::OnQueryTextRectArray() r=m_kato draft
Masayuki Nakano <masayuki@d-toybox.com> - Thu, 14 Jul 2016 22:46:37 +0900 - rev 399830
Push 26007 by masayuki@d-toybox.com at Fri, 12 Aug 2016 06:30:02 +0000
Bug 1286464 part.1 Cleaning up ContentEventHandler::OnQueryTextRectArray() r=m_kato MozReview-Commit-ID: BDLkQLrzoUI
f528daa31337c80b08fc1b3283859c9d8385983e: Bug 1286464 part.0 Add eQueryTextRect tests for line breakers r=smaug draft
Masayuki Nakano <masayuki@d-toybox.com> - Sat, 30 Jul 2016 22:00:30 +0900 - rev 399829
Push 26007 by masayuki@d-toybox.com at Fri, 12 Aug 2016 06:30:02 +0000
Bug 1286464 part.0 Add eQueryTextRect tests for line breakers r=smaug MozReview-Commit-ID: 2SxNlyjc4KM
407c47897cad8c2e4929ed1226073302faaecee2: Bug 1257446 part.3 nsTextFrame::GetCharacterRectsInRange() shouldn't call gfxSkipCharsIterator::AdvanceOriginal() before checking if the current offset has already been reached to the end for avoiding assertions r=jfkthame draft
Masayuki Nakano <masayuki@d-toybox.com> - Thu, 14 Jul 2016 22:02:15 +0900 - rev 399828
Push 26006 by masayuki@d-toybox.com at Fri, 12 Aug 2016 06:28:16 +0000
Bug 1257446 part.3 nsTextFrame::GetCharacterRectsInRange() shouldn't call gfxSkipCharsIterator::AdvanceOriginal() before checking if the current offset has already been reached to the end for avoiding assertions r=jfkthame New eQueryTextRectArray causes a lot of assertions in various automated tests. The cause is that nsTextFrame::GetCharacterRectsInRange() calls gfxSkipCharsIterator::AdvanceOriginal(1) at the end of the |for| loop *without* checking if the iterator has already reached to the end. MozReview-Commit-ID: 3KFxA11uOUc
0343e2eecf5e25043d260157cf4d8b0874e0ceb6: Bug 1257446 part.2 ContentEventHandler::OnQueryTextRectArray() shouldn't set empty rect to the result r=m_kato draft
Masayuki Nakano <masayuki@d-toybox.com> - Tue, 12 Jul 2016 20:28:06 +0900 - rev 399827
Push 26006 by masayuki@d-toybox.com at Fri, 12 Aug 2016 06:28:16 +0000
Bug 1257446 part.2 ContentEventHandler::OnQueryTextRectArray() shouldn't set empty rect to the result r=m_kato Returning empty rects for eQueryTextRectArray causes each dispatcher needing to check every rect. It doesn't make sense especially compared with eQueryTextRect. So, it should ensure that empty rect won't be returned to dispatchers. MozReview-Commit-ID: CpMqqihzSDf
(0) -300000 -100000 -30000 -10000 -3000 -1000 -300 -100 -50 -20 +20 +50 +100 +300 +1000 +3000 +10000 +30000 +100000 +300000 tip