Documentation ¶
Overview ¶
Package view is to inspect and manipulate the visual view of a document.
This includes getting the position of element layout boxes, obtaining the width of the viewport through script, and also scrolling an element.
Index ¶
- type BoxQuadOptions
- type CSSBoxType
- type CaretPosition
- type ConvertCoordinateOptions
- type MediaQueryList
- func (_this *MediaQueryList) AddEventChange(listener func(event *MediaQueryListEvent, currentTarget *MediaQueryList)) js.Func
- func (_this *MediaQueryList) AddListener(listener *domcore.EventListenerValue)
- func (_this *MediaQueryList) Matches() bool
- func (_this *MediaQueryList) Media() string
- func (_this *MediaQueryList) OnChange() domcore.EventHandlerFunc
- func (_this *MediaQueryList) RemoveListener(listener *domcore.EventListenerValue)
- func (_this *MediaQueryList) SetOnChange(listener func(event *MediaQueryListEvent, currentTarget *MediaQueryList)) js.Func
- type MediaQueryListEvent
- type MediaQueryListEventInit
- type Screen
- func (_this *Screen) AddEventChange(listener func(event *domcore.Event, currentTarget *Screen)) js.Func
- func (_this *Screen) AvailHeight() int
- func (_this *Screen) AvailWidth() int
- func (_this *Screen) ColorDepth() uint
- func (_this *Screen) ColorGamut() capabilities.ScreenColorGamut
- func (_this *Screen) Height() int
- func (_this *Screen) JSValue() js.Value
- func (_this *Screen) Luminance() *capabilities.ScreenLuminance
- func (_this *Screen) OnChange() domcore.EventHandlerFunc
- func (_this *Screen) Orientation() *orientation.ScreenOrientation
- func (_this *Screen) PixelDepth() uint
- func (_this *Screen) SetOnChange(listener func(event *domcore.Event, currentTarget *Screen)) js.Func
- func (_this *Screen) Width() int
- type ScrollBehavior
- type ScrollIntoViewOptions
- type ScrollLogicalPosition
- type ScrollOptions
- type ScrollToOptions
- type Union
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BoxQuadOptions ¶
type BoxQuadOptions struct { Box CSSBoxType RelativeTo *Union }
dictionary: BoxQuadOptions
func BoxQuadOptionsFromJS ¶
func BoxQuadOptionsFromJS(value js.Value) *BoxQuadOptions
BoxQuadOptionsFromJS is allocating a new BoxQuadOptions object and copy all values in the value javascript object.
func (*BoxQuadOptions) JSValue ¶
func (_this *BoxQuadOptions) JSValue() js.Value
JSValue is allocating a new javascript object and copy all values
type CSSBoxType ¶
type CSSBoxType int
enum: CSSBoxType
const ( MarginCSSBoxType CSSBoxType = iota BorderCSSBoxType PaddingCSSBoxType ContentCSSBoxType )
func CSSBoxTypeFromJS ¶
func CSSBoxTypeFromJS(value js.Value) CSSBoxType
CSSBoxTypeFromJS is converting a javascript value into a CSSBoxType enum value.
func (*CSSBoxType) JSValue ¶
func (this *CSSBoxType) JSValue() js.Value
JSValue is converting this enum into a javascript object
func (CSSBoxType) Value ¶
func (this CSSBoxType) Value() string
Value is converting this into javascript defined string value
type CaretPosition ¶
class: CaretPosition
func CaretPositionFromJS ¶
func CaretPositionFromJS(value js.Value) *CaretPosition
CaretPositionFromJS is casting a js.Value into CaretPosition.
func CaretPositionFromWrapper ¶
func CaretPositionFromWrapper(input core.Wrapper) *CaretPosition
CaretPositionFromJS is casting from something that holds a js.Value into CaretPosition.
func (*CaretPosition) GetClientRect ¶
func (_this *CaretPosition) GetClientRect() (_result *geometry.DOMRect)
func (*CaretPosition) JSValue ¶
func (_this *CaretPosition) JSValue() js.Value
JSValue returns the js.Value or js.Null() if _this is nil
func (*CaretPosition) Offset ¶
func (_this *CaretPosition) Offset() uint
Offset returning attribute 'offset' with type uint (idl: unsigned long).
func (*CaretPosition) OffsetNode ¶
func (_this *CaretPosition) OffsetNode() js.Value
OffsetNode returning attribute 'offsetNode' with type js.Value (idl: Node).
Example ¶
package main import ( "github.com/gowebapi/webapi/css/cssom/view" "github.com/gowebapi/webapi/dom" ) func main() { var caret *view.CaretPosition // cast to correct type value := dom.NodeFromJS(caret.OffsetNode()) // do something with value _ = value }
Output:
type ConvertCoordinateOptions ¶
type ConvertCoordinateOptions struct { FromBox CSSBoxType ToBox CSSBoxType }
dictionary: ConvertCoordinateOptions
func ConvertCoordinateOptionsFromJS ¶
func ConvertCoordinateOptionsFromJS(value js.Value) *ConvertCoordinateOptions
ConvertCoordinateOptionsFromJS is allocating a new ConvertCoordinateOptions object and copy all values in the value javascript object.
func (*ConvertCoordinateOptions) JSValue ¶
func (_this *ConvertCoordinateOptions) JSValue() js.Value
JSValue is allocating a new javascript object and copy all values
type MediaQueryList ¶
type MediaQueryList struct {
domcore.EventTarget
}
class: MediaQueryList
func MediaQueryListFromJS ¶
func MediaQueryListFromJS(value js.Value) *MediaQueryList
MediaQueryListFromJS is casting a js.Value into MediaQueryList.
func MediaQueryListFromWrapper ¶
func MediaQueryListFromWrapper(input core.Wrapper) *MediaQueryList
MediaQueryListFromJS is casting from something that holds a js.Value into MediaQueryList.
func (*MediaQueryList) AddEventChange ¶
func (_this *MediaQueryList) AddEventChange(listener func(event *MediaQueryListEvent, currentTarget *MediaQueryList)) js.Func
AddChange is adding doing AddEventListener for 'Change' on target. This method is returning allocated javascript function that need to be released.
func (*MediaQueryList) AddListener ¶
func (_this *MediaQueryList) AddListener(listener *domcore.EventListenerValue)
func (*MediaQueryList) Matches ¶
func (_this *MediaQueryList) Matches() bool
Matches returning attribute 'matches' with type bool (idl: boolean).
func (*MediaQueryList) Media ¶
func (_this *MediaQueryList) Media() string
Media returning attribute 'media' with type string (idl: DOMString).
func (*MediaQueryList) OnChange ¶
func (_this *MediaQueryList) OnChange() domcore.EventHandlerFunc
OnChange returning attribute 'onchange' with type domcore.EventHandler (idl: EventHandlerNonNull).
func (*MediaQueryList) RemoveListener ¶
func (_this *MediaQueryList) RemoveListener(listener *domcore.EventListenerValue)
func (*MediaQueryList) SetOnChange ¶
func (_this *MediaQueryList) SetOnChange(listener func(event *MediaQueryListEvent, currentTarget *MediaQueryList)) js.Func
SetOnChange is assigning a function to 'onchange'. This This method is returning allocated javascript function that need to be released.
type MediaQueryListEvent ¶
class: MediaQueryListEvent
func MediaQueryListEventFromJS ¶
func MediaQueryListEventFromJS(value js.Value) *MediaQueryListEvent
MediaQueryListEventFromJS is casting a js.Value into MediaQueryListEvent.
func MediaQueryListEventFromWrapper ¶
func MediaQueryListEventFromWrapper(input core.Wrapper) *MediaQueryListEvent
MediaQueryListEventFromJS is casting from something that holds a js.Value into MediaQueryListEvent.
func NewMediaQueryListEvent ¶
func NewMediaQueryListEvent(_type string, eventInitDict *MediaQueryListEventInit) (_result *MediaQueryListEvent)
func (*MediaQueryListEvent) Matches ¶
func (_this *MediaQueryListEvent) Matches() bool
Matches returning attribute 'matches' with type bool (idl: boolean).
func (*MediaQueryListEvent) Media ¶
func (_this *MediaQueryListEvent) Media() string
Media returning attribute 'media' with type string (idl: DOMString).
type MediaQueryListEventInit ¶
type MediaQueryListEventInit struct { Bubbles bool Cancelable bool Composed bool Media string Matches bool }
dictionary: MediaQueryListEventInit
func MediaQueryListEventInitFromJS ¶
func MediaQueryListEventInitFromJS(value js.Value) *MediaQueryListEventInit
MediaQueryListEventInitFromJS is allocating a new MediaQueryListEventInit object and copy all values in the value javascript object.
func (*MediaQueryListEventInit) JSValue ¶
func (_this *MediaQueryListEventInit) JSValue() js.Value
JSValue is allocating a new javascript object and copy all values
type Screen ¶
class: Screen
func ScreenFromJS ¶
ScreenFromJS is casting a js.Value into Screen.
func ScreenFromWrapper ¶
ScreenFromJS is casting from something that holds a js.Value into Screen.
func (*Screen) AddEventChange ¶
func (_this *Screen) AddEventChange(listener func(event *domcore.Event, currentTarget *Screen)) js.Func
AddChange is adding doing AddEventListener for 'Change' on target. This method is returning allocated javascript function that need to be released.
func (*Screen) AvailHeight ¶
AvailHeight returning attribute 'availHeight' with type int (idl: long).
func (*Screen) AvailWidth ¶
AvailWidth returning attribute 'availWidth' with type int (idl: long).
func (*Screen) ColorDepth ¶
ColorDepth returning attribute 'colorDepth' with type uint (idl: unsigned long).
func (*Screen) ColorGamut ¶
func (_this *Screen) ColorGamut() capabilities.ScreenColorGamut
ColorGamut returning attribute 'colorGamut' with type capabilities.ScreenColorGamut (idl: ScreenColorGamut).
func (*Screen) Luminance ¶
func (_this *Screen) Luminance() *capabilities.ScreenLuminance
Luminance returning attribute 'luminance' with type capabilities.ScreenLuminance (idl: ScreenLuminance).
func (*Screen) OnChange ¶
func (_this *Screen) OnChange() domcore.EventHandlerFunc
OnChange returning attribute 'onchange' with type domcore.EventHandler (idl: EventHandlerNonNull).
func (*Screen) Orientation ¶
func (_this *Screen) Orientation() *orientation.ScreenOrientation
Orientation returning attribute 'orientation' with type orientation.ScreenOrientation (idl: ScreenOrientation).
func (*Screen) PixelDepth ¶
PixelDepth returning attribute 'pixelDepth' with type uint (idl: unsigned long).
type ScrollBehavior ¶
type ScrollBehavior int
enum: ScrollBehavior
const ( AutoScrollBehavior ScrollBehavior = iota SmoothScrollBehavior )
func ScrollBehaviorFromJS ¶
func ScrollBehaviorFromJS(value js.Value) ScrollBehavior
ScrollBehaviorFromJS is converting a javascript value into a ScrollBehavior enum value.
func (*ScrollBehavior) JSValue ¶
func (this *ScrollBehavior) JSValue() js.Value
JSValue is converting this enum into a javascript object
func (ScrollBehavior) Value ¶
func (this ScrollBehavior) Value() string
Value is converting this into javascript defined string value
type ScrollIntoViewOptions ¶
type ScrollIntoViewOptions struct { Behavior ScrollBehavior Block ScrollLogicalPosition Inline ScrollLogicalPosition }
dictionary: ScrollIntoViewOptions
func ScrollIntoViewOptionsFromJS ¶
func ScrollIntoViewOptionsFromJS(value js.Value) *ScrollIntoViewOptions
ScrollIntoViewOptionsFromJS is allocating a new ScrollIntoViewOptions object and copy all values in the value javascript object.
func (*ScrollIntoViewOptions) JSValue ¶
func (_this *ScrollIntoViewOptions) JSValue() js.Value
JSValue is allocating a new javascript object and copy all values
type ScrollLogicalPosition ¶
type ScrollLogicalPosition int
enum: ScrollLogicalPosition
const ( StartScrollLogicalPosition ScrollLogicalPosition = iota CenterScrollLogicalPosition EndScrollLogicalPosition NearestScrollLogicalPosition )
func ScrollLogicalPositionFromJS ¶
func ScrollLogicalPositionFromJS(value js.Value) ScrollLogicalPosition
ScrollLogicalPositionFromJS is converting a javascript value into a ScrollLogicalPosition enum value.
func (*ScrollLogicalPosition) JSValue ¶
func (this *ScrollLogicalPosition) JSValue() js.Value
JSValue is converting this enum into a javascript object
func (ScrollLogicalPosition) Value ¶
func (this ScrollLogicalPosition) Value() string
Value is converting this into javascript defined string value
type ScrollOptions ¶
type ScrollOptions struct {
Behavior ScrollBehavior
}
dictionary: ScrollOptions
func ScrollOptionsFromJS ¶
func ScrollOptionsFromJS(value js.Value) *ScrollOptions
ScrollOptionsFromJS is allocating a new ScrollOptions object and copy all values in the value javascript object.
func (*ScrollOptions) JSValue ¶
func (_this *ScrollOptions) JSValue() js.Value
JSValue is allocating a new javascript object and copy all values
type ScrollToOptions ¶
type ScrollToOptions struct { Behavior ScrollBehavior Left float64 Top float64 }
dictionary: ScrollToOptions
func ScrollToOptionsFromJS ¶
func ScrollToOptionsFromJS(value js.Value) *ScrollToOptions
ScrollToOptionsFromJS is allocating a new ScrollToOptions object and copy all values in the value javascript object.
func (*ScrollToOptions) JSValue ¶
func (_this *ScrollToOptions) JSValue() js.Value
JSValue is allocating a new javascript object and copy all values