# eric6.WebBrowser.Tools.WebHitTestResult

Module implementing an object for testing certain aspects of a web page.

### Global Attributes

None

### Classes

WebHitTestResult | Class implementing an object for testing certain aspects of a web page.

### Functions

None

## WebHitTestResult

Class implementing an object for testing certain aspects of a web page.

### Derived from

object

### Class Attributes

None

### Class Methods

None

### Methods

WebHitTestResult | Constructor
__populate | Private method to populate the object.
alternateText | Public method to get the alternate text.
baseUrl | Public method to get the base URL of the page.
boundingRect | Public method to get the bounding rectangle.
imageUrl | Public method to get the URL of an image.
isContentEditable | Public method to check for editable content.
isContentSelected | Public method to check for selected content.
isNull | Public method to test, if the hit test is empty.
linkTitle | Public method to get the title for a link element.
linkUrl | Public method to get the URL for a link element.
mediaMuted | Public method to check, if a media element is muted.
mediaPaused | Public method to check, if a media element is paused.
mediaUrl | Public method to get the URL for a media element.
pos | Public method to get the position of the hit test.
tagName | Public method to get the name of the tested tag.
updateWithContextMenuData | Public method to update the hit test data with data from the context menu event.
viewportPos | Public method to get the viewport position.

### Static Methods

None

#### WebHitTestResult (Constructor)

WebHitTestResult(page, pos)

Constructor

page (WebBrowserPage)
  reference to the web page
pos (QPoint)
  position to be tested

#### WebHitTestResult.__populate

__populate(url, res)

Private method to populate the object.

url (QUrl)
  URL of the tested page
res (dict)
  dictionary with result data from JavaScript

#### WebHitTestResult.alternateText

alternateText()

Public method to get the alternate text.

Returns:
  alternate text

Return Type:
  str

#### WebHitTestResult.baseUrl

baseUrl()

Public method to get the base URL of the page.

Returns:
  base URL

Return Type:
  QUrl

#### WebHitTestResult.boundingRect

boundingRect()

Public method to get the bounding rectangle.

Returns:
  bounding rectangle

Return Type:
  QRect

#### WebHitTestResult.imageUrl

imageUrl()

Public method to get the URL of an image.

Returns:
  image URL

Return Type:
  QUrl

#### WebHitTestResult.isContentEditable

isContentEditable()

Public method to check for editable content.

Returns:
  flag indicating editable content

Return Type:
  bool

#### WebHitTestResult.isContentSelected

isContentSelected()

Public method to check for selected content.

Returns:
  flag indicating selected content

Return Type:
  bool

#### WebHitTestResult.isNull

isNull()

Public method to test, if the hit test is empty.

Returns:
  flag indicating an empty object

Return Type:
  bool

#### WebHitTestResult.linkTitle

linkTitle()

Public method to get the title for a link element.

Returns:
  title for a link element

Return Type:
  str

#### WebHitTestResult.linkUrl

linkUrl()

Public method to get the URL for a link element.

Returns:
  URL for a link element

Return Type:
  QUrl

#### WebHitTestResult.mediaMuted

mediaMuted()

Public method to check, if a media element is muted.

Returns:
  flag indicating a muted media element

Return Type:
  bool

#### WebHitTestResult.mediaPaused

mediaPaused()

Public method to check, if a media element is paused.

Returns:
  flag indicating a paused media element

Return Type:
  bool

#### WebHitTestResult.mediaUrl

mediaUrl()

Public method to get the URL for a media element.

Returns:
  URL for a media element

Return Type:
  QUrl

#### WebHitTestResult.pos

pos()

Public method to get the position of the hit test.

Returns:
  position of hit test

Return Type:
  QPoint

#### WebHitTestResult.tagName

tagName()

Public method to get the name of the tested tag.

Returns:
  name of the tested tag

Return Type:
  str

#### WebHitTestResult.updateWithContextMenuData

updateWithContextMenuData(data)

Public method to update the hit test data with data from the context menu event.

Note: This works for Qt >= 5.7.0.

data (QWebEngineContextMenuData)
  context menu data

#### WebHitTestResult.viewportPos

viewportPos()

Public method to get the viewport position.

Returns:
  viewport position

Return Type:
  QPoint

Up