Bug 1049010, layout should use composed doc, not current doc in many cases, r=wchen

--HG--
extra : rebase_source : 42ce2eebfd38ea2e6dbe5711954c601f19d72467
This commit is contained in:
Olli Pettay 2014-08-06 02:23:54 +03:00
Родитель 87b818700b
Коммит d2efa2917f
5 изменённых файлов: 6 добавлений и 6 удалений

Просмотреть файл

@ -62,7 +62,7 @@ nsColorControlFrame::GetFrameName(nsAString& aResult) const
nsresult
nsColorControlFrame::CreateAnonymousContent(nsTArray<ContentInfo>& aElements)
{
nsCOMPtr<nsIDocument> doc = mContent->GetCurrentDoc();
nsCOMPtr<nsIDocument> doc = mContent->GetComposedDoc();
mColorContent = doc->CreateHTMLElement(nsGkAtoms::div);
// Mark the element to be native anonymous before setting any attributes.

Просмотреть файл

@ -1466,7 +1466,7 @@ nsComboboxControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
}
// draw a focus indicator only when focus rings should be drawn
nsIDocument* doc = mContent->GetCurrentDoc();
nsIDocument* doc = mContent->GetComposedDoc();
if (doc) {
nsPIDOMWindow* window = doc->GetWindow();
if (window && window->ShouldShowFocusRing()) {

Просмотреть файл

@ -632,7 +632,7 @@ void nsTextControlFrame::SetFocus(bool aOn, bool aRepaint)
if (!isFocusedRightNow) {
// Don't scroll the current selection if we've been focused using the mouse.
uint32_t lastFocusMethod = 0;
nsIDocument* doc = GetContent()->GetCurrentDoc();
nsIDocument* doc = GetContent()->GetComposedDoc();
if (doc) {
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
if (fm) {

Просмотреть файл

@ -165,7 +165,7 @@ nsBoxObject::GetOffsetRect(nsIntRect& aRect)
nsPoint origin = frame->GetPositionIgnoringScrolling();
// Find the frame parent whose content is the document element.
Element *docElement = mContent->GetCurrentDoc()->GetRootElement();
Element* docElement = mContent->GetComposedDoc()->GetRootElement();
nsIFrame* parent = frame->GetParent();
for (;;) {
// If we've hit the document element, break here

Просмотреть файл

@ -2522,7 +2522,7 @@ nsTreeBodyFrame::GetCursor(const nsPoint& aPoint,
// Check the GetScriptHandlingObject so we don't end up running code when
// the document is a zombie.
bool dummy;
if (mView && GetContent()->GetCurrentDoc()->GetScriptHandlingObject(dummy)) {
if (mView && GetContent()->GetComposedDoc()->GetScriptHandlingObject(dummy)) {
int32_t row;
nsTreeColumn* col;
nsIAtom* child;
@ -2803,7 +2803,7 @@ nsTreeBodyFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// Bail out now if there's no view or we can't run script because the
// document is a zombie
if (!mView || !GetContent()->GetCurrentDoc()->GetWindow())
if (!mView || !GetContent ()->GetComposedDoc()->GetWindow())
return;
aLists.Content()->AppendNewToTop(new (aBuilder)