Commit graph

11 commits

Author SHA1 Message Date
Catrope 2008858830 Fix bug in selectNodes: input (0,0) returned []
This was because the while loop was never entered as end >= left was
true from the start. Convert the while loop to a do-while loop to make
sure it runs at least once

Change-Id: I9c6436a7b296e65a36b8301095b6edd00507d321
2012-05-14 21:41:08 -07:00
Trevor Parscal e0de881a8a Removed trailing whitespace in multi-line comment blocks
JSHint and various git tools complain about this, so let's just do away with them altogether

Change-Id: I731866bd21f1ee0088fb0a71df3abf92692aca23
2012-05-14 15:05:09 -07:00
Catrope 6652f7573b Add indexInNode to selectNodes() output
This is for the case where we have a zero-length range in between two
siblings, and we need to know what index that corresponds to in order to
be able to insert nodes there (rebuildNodes() will use it for this
purpose)

Change-Id: I357d1cd665667a76f955a10b8d9d2810976cdbd7
2012-05-10 20:20:42 -07:00
Catrope 379bc8da3c selectNodes() fixes:
* Initialize startOffset to 0 not 1, don't know what I was thinking
* Use currentFrame for nodeRange instead of parentFrame, don't know what
  I was thinking there either
* If the returned node has no parent (is the document node), don't
  attempt to access parentFrame and don't set index

Change-Id: Iad969a7c29436cdf4151ead7e9d3d8e2a30befb3
2012-05-10 20:20:42 -07:00
Catrope 8834145f9e Fix nodeSelectionEqual() so it doesn't explode when a and b have unequal lengths
Change-Id: Idb84bc1238576c711a201cdbf05f63a7b603a819
2012-05-10 16:42:58 -07:00
Catrope 9b6402801a Fix the selectNodes() bug that Inez reported
Selecting a zero-length range at the start or end of a text node
(e.g. (1,1)) would return the text node's parent instead of the text
node

Change-Id: I7fe089bf66b93185dd3415eff53aa7e04e3ffdb2
2012-05-10 16:42:58 -07:00
Catrope f79e56b4f1 Document the stack properties used in selectNodes()
Change-Id: Ibaf178830a0b7b99a4ab1c0ec09283bd3dd552e0
2012-05-10 16:42:58 -07:00
Catrope ec449d168a Fix startOffset computation in selectNodes()
* Needs to be initialized to 1, not 0
* Needs to be stored *after* left is incremented to account for an
  opening

Change-Id: I7978ae241578a8a17120e494684e6e93626a8529
2012-05-10 16:42:58 -07:00
Catrope 38a9b8b301 Fix typo in selectNodes()
Change-Id: I320728bafa289290c4c2a91fee736a8afb17be80
2012-05-10 16:42:58 -07:00
Catrope 13b79d309c Add 'index' and 'nodeRange' to selectNodes() output
Change-Id: I38712545b713cc24663ebec3fe3e5c8741b4fad7
2012-05-10 15:03:23 -07:00
Trevor Parscal 1798a478e7 Massive refactor of node trees, generalizing lots of previously dm only stuff
Change-Id: I9dbb7094f86338ea2e725ad29f66e9e4ca2b52ed
2012-05-09 21:11:09 -07:00