Skip to content
Snippets Groups Projects
Commit 707a9a40 authored by Daniel Holbert's avatar Daniel Holbert
Browse files

Bug 1797148: Simplify checkVisibility API (on nsISelectionController and...

Bug 1797148: Simplify checkVisibility API (on nsISelectionController and nsIFrame) into a single nsTextFrame::HasVisibleText method. r=masayuki

Before this patch, we had two `checkVisibilty` methods on the
nsISelectionController interface, backed by several layers of implementation,
ultimately backed by a single function on nsTextFrame (which didn't actually
do anything meaningful with any of the parameters).

As it turns out, this API only had one caller, in HTMLEditUtils.cpp.

This patch converts that caller to directly query nsTextFrame (if the given
node's primary frame is indeed a nsTextFrame).  The direct function-call is
renamed to HasVisibleText(), to be a bit clearer about it being text-specific
and also to avoid confusion with the (unrelated) recently-specified HTML
checkVisibility() API.

With these changes, we can remove the API from the nsISelectionController
interface and its implementations.

This patch also updates the HTMLEditUtils::IsInVisibleTextFrames documentation
(with s/all/any/) to reflect the reality of what the nsTextFrame impl actually
does.

Differential Revision: https://phabricator.services.mozilla.com/D160563
parent fe1a5646
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment