Fix modification of whitespace endpoints to not assume it's operating on RenderTexts

During line layout, we use midpoints to identify RenderObjects, or parts of
RenderObjects, that don't need InlineBoxes, usually because of collapsed whitespace.

Prior to actually creating BidiRuns (the precursor to InlineBoxes), we use
checkMidpoints to fix up our lineMidpointState to handle the case where we start
ignoring spaces in our line, but don't stop until somewhere on the following line.
Previously, this function assumed that the final midpoint (called an endpoint)
was a RenderText, but this assumption is wrong if we have a beginning midpoint
created by shouldSkipWhitespaceAfterStartObject (which handles inlines and list
markers) and no endpoint on that line. In that case, we'd instead adjust the
position backwards on the beginning midpoint, which would cause us to fail to
create an InlineBox for the inline or list marker. In the new test added, this
would actually trigger a crash due to an assumption when visually re-ordering
BidiRuns that a non-empty line would actually contain at least one such run.

While looking at the code, I also discovered we used INT_MAX as a magic value
for a midpoint's position, but the variable is actually an unsigned. I changed
the magic value to be UINT_MAX.

BUG=166847

Review URL: https://chromiumcodereview.appspot.com/23857005

git-svn-id: svn://svn.chromium.org/blink/trunk@157332 bbb929c8-8fbe-4397-9dbb-9b2b20218538