Forráskód Böngészése

On creating a drag clone, set the style sheet on clone proxy before appending, maybe resolves #191

Michael Ragazzon 4 éve
szülő
commit
f0b1a74520
1 módosított fájl, 5 hozzáadás és 5 törlés
  1. 5 5
      Source/Core/Context.cpp

+ 5 - 5
Source/Core/Context.cpp

@@ -1212,11 +1212,6 @@ void Context::CreateDragClone(Element* element)
 		return;
 	}
 
-	drag_clone = element_drag_clone.get();
-
-	// Append the clone to the cursor proxy element.
-	cursor_proxy->AppendChild(std::move(element_drag_clone));
-
 	// Set the style sheet on the cursor proxy.
 	if (ElementDocument* document = element->GetOwnerDocument())
 	{
@@ -1225,6 +1220,11 @@ void Context::CreateDragClone(Element* element)
 		static_cast<ElementDocument&>(*cursor_proxy).SetStyleSheetContainer(document->style_sheet_container);
 	}
 
+	drag_clone = element_drag_clone.get();
+
+	// Append the clone to the cursor proxy element.
+	cursor_proxy->AppendChild(std::move(element_drag_clone));
+
 	// Set all the required properties and pseudo-classes on the clone.
 	drag_clone->SetPseudoClass("drag", true);
 	drag_clone->SetProperty(PropertyId::Position, Property(Style::Position::Absolute));