Home

# Library goog.editor.style

Function Summary
| `cancelMouseDownHelper_(?goog.events.Event e)` Prevent the default action on mousedown events.
| `getComputedOrCascadedStyle_(?Node node, string stylePropertyName) ⇒ ?string` Gets the computed or cascaded style. This is different than goog.style.getStyle_ because it returns null for text nodes (instead of throwing an exception), and never reads inline style. These two functions may need to be reconciled.
| `getContainer(?Node node) ⇒ ?Element` Return the first ancestor of this node that is a container, inclusive.
| `isContainer(?Node element) ⇒ boolean` Returns true if the element is a container of other non-inline HTML Note that span, strong and em tags, being inline can only contain other inline elements and are thus, not containers. Containers are elements that should not be broken up when wrapping selections with a node of an inline block styling.
| `isDisplayBlock(?Node node) ⇒ boolean` Checks whether the given element inherits display: block.

`makeSelectable(?Element element)`

Make the given element selectable. For IE this simply turns off the "unselectable" property. Under FF no descendent of an unselectable node can be selectable: https://bugzilla.mozilla.org/show_bug.cgi?id=203291 So we make each ancestor of node selectable, while trying to preserve the unselectability of other nodes along that path This may cause certain text nodes which should be unselectable, to become selectable. For example:

Text1 Text2
If we call makeSelectable on span1, then it will cause "Text1" to become selectable, since it had to make div1 selectable in order for span1 to be selectable. If "Text1" were enclosed within a

or , then this problem would not arise. Text nodes do not have styles, so its style can't be set to unselectable.

| `makeUnselectable(?Element element, ?goog.events.EventHandler eventHandler)` Makes the given element unselectable, as well as all of its children, except for text areas, text, file and url inputs.