зеркало из https://github.com/mozilla/gecko-dev.git
Bug 845595 - Make nsIDOMWindowUtils::selectAtPoint coordinates relative to the DWU's document. r=jimm
This commit is contained in:
Родитель
2e8db46be9
Коммит
a5307d1c97
|
@ -3011,8 +3011,9 @@ nsDOMWindowUtils::SelectAtPoint(float aX, float aY, uint32_t aSelectBehavior,
|
|||
}
|
||||
|
||||
// Get the target frame at the client coordinates passed to us
|
||||
nsCOMPtr<nsIWidget> widget = GetWidget();
|
||||
nsIntPoint pt(aX, aY);
|
||||
nsPoint offset;
|
||||
nsCOMPtr<nsIWidget> widget = GetWidget(&offset);
|
||||
nsIntPoint pt = ToWidgetPoint(aX, aY, offset, GetPresContext());
|
||||
nsPoint ptInRoot =
|
||||
nsLayoutUtils::GetEventCoordinatesRelativeTo(widget, pt, rootFrame);
|
||||
nsIFrame* targetFrame = nsLayoutUtils::GetFrameForPoint(rootFrame, ptInRoot);
|
||||
|
|
|
@ -164,8 +164,8 @@
|
|||
|
||||
let rect = frame.getBoundingClientRect();
|
||||
|
||||
let targetPoint = { xPos: rect.left + (charDims.width / 2),
|
||||
yPos: rect.top + (charDims.height / 2) };
|
||||
let targetPoint = { xPos: charDims.width / 2,
|
||||
yPos: charDims.height / 2 };
|
||||
setSingle(dwuFrame, targetPoint.xPos, targetPoint.yPos, Ci.nsIDOMWindowUtils.SELECT_WORDNOSPACE);
|
||||
checkSelection(frame.contentWindow.document, "SELECT_WORDNOSPACE", "ttestselection2");
|
||||
setSingle(dwuFrame, targetPoint.xPos, targetPoint.yPos, Ci.nsIDOMWindowUtils.SELECT_WORD);
|
||||
|
|
Загрузка…
Ссылка в новой задаче