Rename IsEmpty*() of editor to explain their jobs

NEW
Unassigned

Status

()

Core
Editor
P3
normal
a year ago
11 months ago

People

(Reporter: masayuki, Unassigned)

Tracking

(Depends on: 3 bugs, Blocks: 1 bug)

Trunk
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

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.
Depends on: 1359393
Depends on: 1359396
Depends on: 1359398
Depends on: 1359404
status-firefox57: affected → ---

Updated

11 months ago
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.