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.
76 77 78 79 80 81 82 83 |
# File 'lib/webkit_remote_unstable/dom.rb', line 76 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.
60 61 62 |
# File 'lib/webkit_remote_unstable/dom.rb', line 60 def border @border end |
#content ⇒ DomQuad (readonly)
Returns the content’s boundary.
64 65 66 |
# File 'lib/webkit_remote_unstable/dom.rb', line 64 def content @content end |
#height ⇒ Number (readonly)
Returns the box’s height.
69 70 71 |
# File 'lib/webkit_remote_unstable/dom.rb', line 69 def height @height end |
#margin ⇒ DomQuad (readonly)
Returns the margin’s boundary.
58 59 60 |
# File 'lib/webkit_remote_unstable/dom.rb', line 58 def margin @margin end |
#padding ⇒ DomQuad (readonly)
Returns the padding’s boundary.
62 63 64 |
# File 'lib/webkit_remote_unstable/dom.rb', line 62 def padding @padding end |
#width ⇒ Number (readonly)
Returns the box’s width.
67 68 69 |
# File 'lib/webkit_remote_unstable/dom.rb', line 67 def width @width end |