Node::lazyAttach should traverse into ShadowRoots

We never mark ShadowRoot as needing a lazyAttach so it doesn't have the right bits
set and you can end up in situations where the ShadowRoot is never attached and
distribution never runs.

I added a check to Document::recalcStyle that prints out any element that still
needsStyleRecalc() at the end of the function and this change makes sure that
all elements have their style recalculated at the end of recalcStyle.

This has proved hard to create a reduced test case for but we should add one eventually.
Right now this change makes sense purely from a correctness standpoint even if it wasn't
fixing the bug.

BUG=260509

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

git-svn-id: svn://svn.chromium.org/blink/trunk@154720 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Rework checkForSiblingStyleChanges to abort earlier

This reorders the operations in checkForSiblingStyleChanges to bail out earlier in
more cases. Specifically if we call setNeedsStyleRecalc() on the element we don't 
need to continue looking for children to call it on. We can also early return if
the element already needs a SubtreeStyleChange or the document has a pending forced
style recalc.

I also swapped out manual versions of firstElementChild, lastElementChild,
nextElementSibling and previousElementSibling with the actual methods and changed it to
not call renderStyle() repeatedly since that contains two branches and a possible
virtual call.

R=eseidel@chromium.org,ojan@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@154721 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Avoid scanning really wide DOMs in textRendererIsNeeded.

Avoiding creation of a Renderer for the text node is a non-essential memory
optimization. So to avoid blowing up on very wide DOMs, this patch limits the
number of siblings to visit to 50.

It improves the page load time of http://alexaing.com/ (slowest parse time in
alexa top million) from 16.4s -> 4.4s on my z620 linux workstation.

BUG=261308

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

git-svn-id: svn://svn.chromium.org/blink/trunk@154722 bbb929c8-8fbe-4397-9dbb-9b2b20218538
FormAssociatedElement shouldn't create out-of-tree FormAttributeTargetObserver.

This change addes an inDocument() check to prevent the observer creation
for out-of-document elements. It also adds an ASSERT() to clarify the invariant.

BUG=261609
TEST=fieldset-shadowdom-crash.html
R=tkent,inferno

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

git-svn-id: svn://svn.chromium.org/blink/trunk@154723 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Move CSS RuleFeature away from AtomicStringImpl.

We now use AtomicString directly instead, to avoid an object lifetime issue.

BUG=257145
TEST=LayoutTests under ASAN

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

git-svn-id: svn://svn.chromium.org/blink/trunk@154724 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Move Custom Element:definition mapping out of the registration context.

So that Custom Elements may outlive their registration context, it is
necessary to move per-instance state out of the registration context.

BUG=255725

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

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