Skip to content

DOMRect doesn't work in some browsers #7036

@SymbolicallyMe

Description

@SymbolicallyMe

Describe the bug
The function/constructor DOMRect, used in dom.js (line 160), does not work in Chrome 56, IE 11 and Microsoft Edge, but works in FireFox and Safari.
screen shot 2018-05-30 at 8 08 04 pm

To Reproduce

  1. Add the Table block
  2. Open the command line
  3. Click on an empty table cell (you should get an error in the console for the browsers mentioned above).

Expected behavior
When clicking on an empty table cell within the Table block, and error should not occur.

Possible Solution
Since DOMRect works only in some browsers, a polyfill or mock DOMRect function should be created or used in place of it. TinyMCE provides it's own function to create Rectangles without issue.

import tinymce from 'tinymce';
var rectangle = tinymce.geom.Rect.create( x, y, width, height );

Screenshots
screen shot 2018-05-30 at 10 31 28 am

Relate Issues
#6666

Metadata

Metadata

Assignees

Labels

FrameworkIssues related to broader framework topics, especially as it relates to javascript[Priority] HighUsed to indicate top priority items that need quick attention[Type] BugAn existing feature does not function as intended

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions