CSP: Separate side-effects of parsing from the parsing code.

This patch shouldn't have any practical effect on CSP, but it will make
it straightforward to separate side-effects from parsing in a future
patch.

BUG=411889

Review URL: https://codereview.chromium.org/550223002

git-svn-id: svn://svn.chromium.org/blink/trunk@181632 bbb929c8-8fbe-4397-9dbb-9b2b20218538
[CSS Grid Layout] Ignore positioned block item added after inline

Right now if you add a positioned block item after an inline item, the
positioned block item is inserted inside the anonymous block wrapping
the inline item.

This was causing an assert in RenderGrid::addChildToIndexesMap() while
navigating the sibling boxes, as its previous sibling is an inline.

As the positioned block is now not direct child of the grid, we can
ignore it, as it's not considered a grid item. The grid item would
be the anonymous block. So the proper check is added in
RenderGrid::addChild to do it.

BUG=401463
TEST=fast/css-grid-layout/grid-add-positioned-block-item-after-inline-item.html

Review URL: https://codereview.chromium.org/450783002

git-svn-id: svn://svn.chromium.org/blink/trunk@181633 bbb929c8-8fbe-4397-9dbb-9b2b20218538
[CSS Grid Layout] Heap-buffer-overflow in std::sort()

r179621 added support to handle infinite sizes to the
sortByGridTrackGrowthPotential() sorting function. The problem is that it broke
the strict weak ordering required by std::sort when the compared items had both
infinite maximum sizes, so the algorithm was going nuts.

BUG=401983, 402508, 402757

Review URL: https://codereview.chromium.org/493093002

git-svn-id: svn://svn.chromium.org/blink/trunk@181634 bbb929c8-8fbe-4397-9dbb-9b2b20218538
HTMLConstructionSite: avoid n^2 running time for large scripts.

Every time background parser sends chunk, tree is flushed.

If page contains very large script, then script node content is updated
many times. Every update is causes string concatenation.

Solution: do not flush pending text until it is mandatory.

Test: https://codereview.chromium.org/500363002
Test depends on: https://codereview.chromium.org/544453004/

BUG=410790

Review URL: https://codereview.chromium.org/494993002

git-svn-id: svn://svn.chromium.org/blink/trunk@181635 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Word-Spacing in InlineBox RTL scenario not to ignore if first character is space

InlineFlowBox, sets word spacing first if in LTR scenario. In RTL scenario first logicalLeft should be set prior to setting word-spacing length.

RenderBlockLineLayout, sets needsWordSpacing as true to not ignore space if first character.

BUG=344873
R=behdad,eae, aharon
TEST=fast/text/international/bidi-word-spacing.html

Review URL: https://codereview.chromium.org/529753002

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