Merge HTMLBodyElement::didNotifySubtreeInsertions into HTMLBodyElement::insertedInto
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Sep 2013 23:58:54 +0000 (23:58 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Sep 2013 23:58:54 +0000 (23:58 +0000)
commitca4d99be37a96c65d2e76da0a504e8bb6eeb8d8f
treeee1184d1760bf6a2ac56b749aae7a3b0f840a1f6
parent8318b7812c7eeedda355819cc8fc32044c3afd6f
Merge HTMLBodyElement::didNotifySubtreeInsertions into HTMLBodyElement::insertedInto
https://bugs.webkit.org/show_bug.cgi?id=121576

Reviewed by Andreas Kling.

Source/WebCore:

Merge https://chromium.googlesource.com/chromium/blink/+/2a9cac908f4eceadfcf9d21bdf5b3e598075aa1f

The logic in didNotifySubtreeInsertions to set the marginwidth and marginheight attributes
on the <body> of elements inside <iframe> and <frame> doesn't need to run after inserting
all the children of the frame. In fact this means that when you have those attributes
and then the script in the iframe touches offsetLeft or any layout dependent property
we'll layout with the wrong values and then have to do another layout after these margin
attributes are set.

I also remove the scheduleRelayout() call that was inside didNotifySubtreeInsertions. This
call doesn't make any sense, inserting a <body> will always trigger a style recalc and
a subsequent layout. The code is 9 years old: https://trac.webkit.org/changeset/8122
and all tests run fine without it.

* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::insertedInto):
* html/HTMLBodyElement.h:
* html/HTMLFrameElementBase.h:
(WebCore::isHTMLFrameElementBase):
(WebCore::toHTMLFrameElementBase):

LayoutTests:

Rebaseline a test now that we don't do an extra layout.

* inspector/timeline/timeline-script-tag-1-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@156072 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/inspector/timeline/timeline-script-tag-1-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLBodyElement.cpp
Source/WebCore/html/HTMLBodyElement.h
Source/WebCore/html/HTMLFrameElementBase.h