Closed Bug 1359392 Opened 7 years ago Closed 4 months ago

Rename IsEmpty*() of editor to explain their jobs

Categories

(Core :: DOM: Editor, defect, P3)

defect

Tracking

()

RESOLVED WONTFIX

People

(Reporter: masayuki, Unassigned)

References

(Depends on 2 open bugs, Blocks 1 open bug)

Details

HTMLEditor::IsEmptyNodeImpl() should be IsVisibleNodeExceptUneditableChildrenInternal(). (I have no better idea which explain what this method does.)

/**
 * If aNode is a text node, returns false when it has non-whitespace
 * characters.
 * If aNode is <a name="foo">, a form control or not a container node
 * like <br>, returns false.
 * If aNode is a list item or a table cell and aListOrCellNotEmpty is
 * true, returns false.
 * Otherwise, if aNode has a visible and editable descendant, returns
 * false.
 */

HTMLEditor::IsEmptyNode() should be IsVisibleNodeExceptUneditableChildren().

HTMLEditor::IsEmptyCell() should be IsVisibleCellExceptUneditableChildren().

/**
 * If aNode has a <br> element or a visible and editable descendant,
 * returns false.  Otherwise, returns true.
 * Note that this doesn't refer actual frame information at checking
 * text node visibility.
 */

HTMLEditRules::IsEmptyBlock() should be IsVisbleBlockExceptUneditableChildren().

/**
 * If aNode is not a block or has a visible and editable descendant,
 * returns false.
 */

HTMLEditRules::IsEmpytInline() should be IsVisibleInlineExceptUneditableChildren().

/**
 * If aNode is not an inline element or has a visible and editable
 * descendant, returns false.
 */

Some of the comments are not same as current behavior. I think that the different points are bugs due to not making sense even with current names. See blocker bugs of this bug for the detail.
Priority: -- → P3
Severity: normal → S3

I think that we don't need to work on this bug because we have EnumSet and options explain the details.

Status: NEW → RESOLVED
Closed: 4 months ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.