# eric7.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

None

### 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.

Return:
  alternate text

Return Type:
  str

#### WebHitTestResult.baseUrl

baseUrl()

Public method to get the base URL of the page.

Return:
  base URL

Return Type:
  QUrl

#### WebHitTestResult.boundingRect

boundingRect()

Public method to get the bounding rectangle.

Return:
  bounding rectangle

Return Type:
  QRect

#### WebHitTestResult.imageUrl

imageUrl()

Public method to get the URL of an image.

Return:
  image URL

Return Type:
  QUrl

#### WebHitTestResult.isContentEditable

isContentEditable()

Public method to check for editable content.

Return:
  flag indicating editable content

Return Type:
  bool

#### WebHitTestResult.isContentSelected

isContentSelected()

Public method to check for selected content.

Return:
  flag indicating selected content

Return Type:
  bool

#### WebHitTestResult.isNull

isNull()

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

Return:
  flag indicating an empty object

Return Type:
  bool

#### WebHitTestResult.linkTitle

linkTitle()

Public method to get the title for a link element.

Return:
  title for a link element

Return Type:
  str

#### WebHitTestResult.linkUrl

linkUrl()

Public method to get the URL for a link element.

Return:
  URL for a link element

Return Type:
  QUrl

#### WebHitTestResult.mediaMuted

mediaMuted()

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

Return:
  flag indicating a muted media element

Return Type:
  bool

#### WebHitTestResult.mediaPaused

mediaPaused()

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

Return:
  flag indicating a paused media element

Return Type:
  bool

#### WebHitTestResult.mediaUrl

mediaUrl()

Public method to get the URL for a media element.

Return:
  URL for a media element

Return Type:
  QUrl

#### WebHitTestResult.pos

pos()

Public method to get the position of the hit test.

Return:
  position of hit test

Return Type:
  QPoint

#### WebHitTestResult.tagName

tagName()

Public method to get the name of the tested tag.

Return:
  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.

data (QWebEngineContextMenuRequest)
  context menu data

#### WebHitTestResult.viewportPos

viewportPos()

Public method to get the viewport position.

Return:
  viewport position

Return Type:
  QPoint

Up