Class: WebkitRemote::Client::DomBoxModel
- Inherits:
-
Object
- Object
- WebkitRemote::Client::DomBoxModel
- Defined in:
- lib/webkit_remote_unstable/dom.rb
Overview
Box model layout information for an element.
Instance Attribute Summary collapse
-
#border ⇒ DomQuad
readonly
The border’s boundary.
-
#content ⇒ DomQuad
readonly
The content’s boundary.
-
#height ⇒ Number
readonly
The box’s height.
-
#margin ⇒ DomQuad
readonly
The margin’s boundary.
-
#padding ⇒ DomQuad
readonly
The padding’s boundary.
-
#width ⇒ Number
readonly
The box’s width.
Instance Method Summary collapse
-
#initialize(raw_box_model) ⇒ DomBoxModel
constructor
Wraps raw box model data received via a RPC call.
Constructor Details
#initialize(raw_box_model) ⇒ DomBoxModel
Wraps raw box model data received via a RPC call.
68 69 70 71 72 73 74 75 |
# File 'lib/webkit_remote_unstable/dom.rb', line 68 def initialize(raw_box_model) @width = raw_box_model['width'] @height = raw_box_model['height'] @margin = WebkitRemote::Client::DomQuad.new raw_box_model['margin'] @border = WebkitRemote::Client::DomQuad.new raw_box_model['border'] @padding = WebkitRemote::Client::DomQuad.new raw_box_model['padding'] @content = WebkitRemote::Client::DomQuad.new raw_box_model['content'] end |
Instance Attribute Details
#border ⇒ DomQuad (readonly)
Returns the border’s boundary.
52 53 54 |
# File 'lib/webkit_remote_unstable/dom.rb', line 52 def border @border end |
#content ⇒ DomQuad (readonly)
Returns the content’s boundary.
56 57 58 |
# File 'lib/webkit_remote_unstable/dom.rb', line 56 def content @content end |
#height ⇒ Number (readonly)
Returns the box’s height.
61 62 63 |
# File 'lib/webkit_remote_unstable/dom.rb', line 61 def height @height end |
#margin ⇒ DomQuad (readonly)
Returns the margin’s boundary.
50 51 52 |
# File 'lib/webkit_remote_unstable/dom.rb', line 50 def margin @margin end |
#padding ⇒ DomQuad (readonly)
Returns the padding’s boundary.
54 55 56 |
# File 'lib/webkit_remote_unstable/dom.rb', line 54 def padding @padding end |
#width ⇒ Number (readonly)
Returns the box’s width.
59 60 61 |
# File 'lib/webkit_remote_unstable/dom.rb', line 59 def width @width end |