mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1145395 - Introduce an overload of nsHTMLEditor::SelElementPosition that takes an Element; r=ehsan
This commit is contained in:
parent
d457a0c0ab
commit
f402d96073
@ -500,7 +500,7 @@ nsHTMLEditor::AbsolutelyPositionElement(nsIDOMElement* aElement,
|
||||
|
||||
AddPositioningOffset(x, y);
|
||||
SnapToGrid(x, y);
|
||||
SetElementPosition(aElement, x, y);
|
||||
SetElementPosition(*element, x, y);
|
||||
|
||||
// we may need to create a br if the positioned element is alone in its
|
||||
// container
|
||||
@ -579,13 +579,19 @@ nsHTMLEditor::SetElementPosition(nsIDOMElement *aElement, int32_t aX, int32_t aY
|
||||
{
|
||||
nsCOMPtr<Element> element = do_QueryInterface(aElement);
|
||||
NS_ENSURE_STATE(element);
|
||||
nsAutoEditBatch batchIt(this);
|
||||
|
||||
mHTMLCSSUtils->SetCSSPropertyPixels(*element, *nsGkAtoms::left, aX);
|
||||
mHTMLCSSUtils->SetCSSPropertyPixels(*element, *nsGkAtoms::top, aY);
|
||||
SetElementPosition(*element, aX, aY);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
nsHTMLEditor::SetElementPosition(dom::Element& aElement, int32_t aX, int32_t aY)
|
||||
{
|
||||
nsAutoEditBatch batchIt(this);
|
||||
mHTMLCSSUtils->SetCSSPropertyPixels(aElement, *nsGkAtoms::left, aX);
|
||||
mHTMLCSSUtils->SetCSSPropertyPixels(aElement, *nsGkAtoms::top, aY);
|
||||
}
|
||||
|
||||
// self-explanatory
|
||||
NS_IMETHODIMP
|
||||
nsHTMLEditor::GetPositionedElement(nsIDOMElement ** aReturn)
|
||||
|
@ -754,6 +754,9 @@ protected:
|
||||
nsresult ClearStyle(nsCOMPtr<nsIDOMNode>* aNode, int32_t* aOffset,
|
||||
nsIAtom* aProperty, const nsAString* aAttribute);
|
||||
|
||||
void SetElementPosition(mozilla::dom::Element& aElement,
|
||||
int32_t aX, int32_t aY);
|
||||
|
||||
// Data members
|
||||
protected:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user