Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Taming Contenteditable with Ember.js

Taming Contenteditable with Ember.js

paddyobrien

July 23, 2015
Tweet

Other Decks in Technology

Transcript

  1. 4

  2. 5

  3. 6

  4. 7

  5. 12

  6. 13

  7. contenteditable • What about backspace? • <p> has a line-height

    of 1.5em Chrome becomes <p contenteditable> d|d </p> <p contenteditable> d|<span style="line-height: 1.5em;”>d</span> </p>
  8. 22

  9. The BOM The DOM Editor View Event Handling DOM Selection

    UI Coordinates Rendering Composer component
  10. The BOM Composer State BOM Selection Undo Stack Blocks The

    DOM Editor View Event Handling DOM Selection UI Coordinates Rendering Composer component Commands
  11. Paragraph Composer State Block Selection Undo Stack Block List Item

    Ordered List Command • Backspace • Delete • Return • Sync • Insert Attribute • Insert Character • Insert Block • Paste • ...
  12. Blocks Paragraph text: “hello there” Entities Italic (0 -> 5)

    Bold (6 -> 14) Selection: 0:0:1 → 0:0:1
  13. Blocks Paragraph text: “hello there” Entities Italic (0 -> 5)

    Bold (6 -> 14) Selection: 0:0:2 → 0:0:9
  14. Blocks Paragraph text: “hello there” Entities Italic (0 -> 5)

    Bold (9 -> 14) Selection: 0:0:2 → 0:0:9
  15. Blocks Paragraph text: “hello there” Entities Italic (0 -> 5)

    Bold (2 -> 14) Selection: 0:0:2 → 0:0:9
  16. Syncing UI Event Command Mutate BOM Rerender? Can Browser handle

    it? No Do Nothing Yes Should we let the BOM know? Yes