Class: SilkLayout::Layout::Engine
- Inherits:
-
Object
- Object
- SilkLayout::Layout::Engine
- Defined in:
- lib/silk_layout/layout/engine.rb
Constant Summary collapse
- DEFAULT_VIEWPORT_WIDTH =
800
Class Method Summary collapse
Class Method Details
.layout(dom, css_rules, viewport_width: DEFAULT_VIEWPORT_WIDTH) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/silk_layout/layout/engine.rb', line 8 def self.layout(dom, css_rules, viewport_width: DEFAULT_VIEWPORT_WIDTH) CSS::Cascade.apply(dom, css_rules) box_tree = FormattingBuilder.build(dom) root = Root.find(box_tree) context = Context.new(width: ) BlockLayout.layout(root, context) root end |