-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbugs.txt
56 lines (45 loc) · 3.85 KB
/
bugs.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
fixed:
2: Text.wholeText or for that matter $(Text).text() of a split text node returns the entire text of the normalized nodes.
eg: text -> "lol"
text1 = text.splitText(1);
text1.wholeText === text.wholeText -> true
Fix: don't use the text() to wrap the text node, simply clone it, delete the content of the previous and append the clone
3: inserting element in contentEditable sets the caret before the inserted element
Fix: http://stackoverflow.com/questions/4834793/set-caret-position-right-after-the-inserted-element-in-a-contenteditable-div
4: PERFORMANCE
wrapping inserted elements create a really deep tree that slows down everything
possible solutions are:
wrap and make it a sibling instead of a child of the element where he is inserted
extra: wait for the animation to end to unwrap
FIX: copy paste from the same chat is sanitized. by sanitized what I mean is that fader elements and span elements are removed, but not its content. span elements are removed as well, because when copy pasted an element the currect color is passed as inline style and that element put inside a span element, this conflicts with cooling animation, that uses the CSS selector which has lower priority than inline style.
5: pasting html code with inline color conflicts with the color cooling animation
FIX: using regex the inserted html code if first sanitized of color
6: unwrapping a fader creates a reflow on its children, that if faders as well will have their animation reseted.
possible solutions:
1.when wrapping a content with a fader, bump the fading wrapping one level in the tree hierarchy, but still keeping the overall content organization.
possible problems:
in order to do this the enclosing node of the fader, might have to be split.
take a look at this example:
<fader>lol<fader id="theFaderWeWantToBump"></fader>pois></fader>
in order to bump it we will need to turn it to this:
<fader>lol</fader>
<fader id="theFaderWeWantToBump"></fader>
<fader>pois</fader>
this might cause a reflow on what was previously the parent and is now the siblings of the fader we have been discussing
pros:
the tree grows in breadth, instead of depth. this not only fixes the bug6, but possibly also increases performance
2.
7: when wrapping a text node, its siblings (at least its preceding siblings) are firing the mutation summary and reporting themselves as just added and in turn getting an unnecessary wrap that makes tree grow deeper and deeper; it also fires a reflow on that wrapped element.
temporary solution:
added nodes that have a fader as their parent and have one children don't get wrapped(faded)
this fixes most cases, but not all I think
this solution also works because text that is added also fires the charactedData event, and it's there that the text is wrapped(faded)
8. input sometimes gets deleted
FIX: input variable was actually a jquery node and it was being compared against proper DOM nodes
9. can't create more than two lines sequenced when there is already text present on the line of creation
oddities:
.for whatever reason, when on the cursor is inside a <fader>, with no children apart from text nodes, a newline creates a div that has a <br> wrapped in a <fader>, that's when it works. when it doesn't work is two faders, father and son, wrapping a <br>
.in some cases the entire subtree, where the newline is requested, gets unwrapped of faders, which triggers a reflow and makes the cooling animation behave erratically. it does clean up the tree though
suspicion:
it seems the problem is where the cursor ends, because the divs apparently are getting created
10. some new text node where not being wrapped properly, because the changedTextNode was being compared under the assumption that its value hadn't changed, where in fact the node had already by split previously