1.19 <WebKitHitTestResult>

Class: <WebKitHitTestResult>

It derives from <GObject>.

Result of a Hit Test.

A Hit Test is an operation to get context information about a given point in a <WebKitWebView>. <WebKitHitTestResult> represents the result of a Hit Test. It provides context information about what is at the coordinates of the Hit Test, such as if there’s a link, an image or a media.

You can get the context of the HitTestResult with hit-test-result:get-context that returns a bitmask of <WebKitHitTestResultContext> flags. You can also use hit-test-result:context-is-link?, hit-test-result:context-is-image? and hit-test-result:context-is-media? to determine whether there’s a link, image or a media element at the coordinates of the Hit Test. Note that it’s possible that several <WebKitHitTestResultContext> flags are active at the same time, for example if there’s a link containing an image.

When the mouse is moved over a <WebKitWebView> a Hit Test is performed for the mouse coordinates and web-view:mouse-target-changed signal is emitted with a <WebKitHitTestResult>.

Properties

Property: hit-test-result:context self

Bitmask of <WebKitHitTestResultContext> flags representing the context of the <WebKitHitTestResult>.

Its value is an unsigned 32-bit integer.

It can only be set when the object is made, with #:context.

Property: hit-test-result:image-uri self

The URI of the image if flag image is present in hit-test-result:context

Its value is a string, or #f.

It can only be set when the object is made, with #:image-uri.

The label of the link if flag link is present in hit-test-result:context

Its value is a string, or #f.

It can only be set when the object is made, with #:link-label.

The title of the link if flag link is present in hit-test-result:context

Its value is a string, or #f.

It can only be set when the object is made, with #:link-title.

The URI of the link if flag link is present in hit-test-result:context

Its value is a string, or #f.

It can only be set when the object is made, with #:link-uri.

Property: hit-test-result:media-uri self

The URI of the media if flag media is present in hit-test-result:context

Its value is a string, or #f.

It can only be set when the object is made, with #:media-uri.

Procedures

Method: hit-test-result:context-is-editable? self ⇒ %return
Method: context-is-editable? self ⇒ %return

Gets whether editable flag is present in hit-test-result:context.

self

Passed: a <WebKitHitTestResult>.

a <WebKitHitTestResult>

%return

Returned: a boolean.

#t if there’s an editable element at the coordinates of the self, or #f otherwise

Method: hit-test-result:context-is-image? self ⇒ %return
Method: context-is-image? self ⇒ %return

Gets whether image flag is present in hit-test-result:context.

self

Passed: a <WebKitHitTestResult>.

a <WebKitHitTestResult>

%return

Returned: a boolean.

#t if there’s an image element in the coordinates of the Hit Test, or #f otherwise

Gets whether link flag is present in hit-test-result:context.

self

Passed: a <WebKitHitTestResult>.

a <WebKitHitTestResult>

%return

Returned: a boolean.

#t if there’s a link element in the coordinates of the Hit Test, or #f otherwise

Method: hit-test-result:context-is-media? self ⇒ %return
Method: context-is-media? self ⇒ %return

Gets whether media flag is present in hit-test-result:context.

self

Passed: a <WebKitHitTestResult>.

a <WebKitHitTestResult>

%return

Returned: a boolean.

#t if there’s a media element in the coordinates of the Hit Test, or #f otherwise

Method: hit-test-result:context-is-scrollbar? self ⇒ %return
Method: context-is-scrollbar? self ⇒ %return

Gets whether scrollbar flag is present in hit-test-result:context.

self

Passed: a <WebKitHitTestResult>.

a <WebKitHitTestResult>

%return

Returned: a boolean.

#t if there’s a scrollbar element at the coordinates of the self, or #f otherwise

Method: hit-test-result:context-is-selection? self ⇒ %return
Method: context-is-selection? self ⇒ %return

Gets whether selection flag is present in hit-test-result:context.

self

Passed: a <WebKitHitTestResult>.

a <WebKitHitTestResult>

%return

Returned: a boolean.

#t if there’s a selected element at the coordinates of the self, or #f otherwise

Method: hit-test-result:get-context self ⇒ %return
Method: get-context self ⇒ %return

Gets the value of the hit-test-result:context property.

self

Passed: a <WebKitHitTestResult>.

a <WebKitHitTestResult>

%return

Returned: an unsigned 32-bit integer.

a bitmask of <WebKitHitTestResultContext> flags

Method: hit-test-result:get-image-uri self ⇒ %return
Method: get-image-uri self ⇒ %return

Gets the value of the hit-test-result:image-uri property.

self

Passed: a <WebKitHitTestResult>.

a <WebKitHitTestResult>

%return

Returned: a string.

the URI of the image element in the coordinates of the Hit Test, or #f if there isn’t an image element in self context

Gets the value of the hit-test-result:link-label property.

self

Passed: a <WebKitHitTestResult>.

a <WebKitHitTestResult>

%return

Returned: a string.

the label of the link element in the coordinates of the Hit Test, or #f if there isn’t a link element in self context or the link element doesn’t have a label

Gets the value of the hit-test-result:link-title property.

self

Passed: a <WebKitHitTestResult>.

a <WebKitHitTestResult>

%return

Returned: a string.

the title of the link element in the coordinates of the Hit Test, or #f if there isn’t a link element in self context or the link element doesn’t have a title

Gets the value of the hit-test-result:link-uri property.

self

Passed: a <WebKitHitTestResult>.

a <WebKitHitTestResult>

%return

Returned: a string.

the URI of the link element in the coordinates of the Hit Test, or #f if there isn’t a link element in self context

Method: hit-test-result:get-media-uri self ⇒ %return
Method: get-media-uri self ⇒ %return

Gets the value of the hit-test-result:media-uri property.

self

Passed: a <WebKitHitTestResult>.

a <WebKitHitTestResult>

%return

Returned: a string.

the URI of the media element in the coordinates of the Hit Test, or #f if there isn’t a media element in self context