Class: CSSPool::LibCroco::CRSelector

Inherits:
FFI::Struct
  • Object
show all
Defined in:
lib/csspool/lib_croco/cr_selector.rb

Instance Method Summary collapse

Instance Method Details

#to_selectorObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/csspool/lib_croco/cr_selector.rb', line 14

def to_selector
  simple_selectors = []
  pointer = self[:simple_sel]

  until pointer.null?
    simple_selectors << CRSimpleSel.new(pointer)
    pointer = simple_selectors.last[:next]
  end

  simple_selectors = simple_selectors.map { |sel| sel.to_simple_selector }

  Selector.new simple_selectors, {
    :line         => self[:line],
    :column       => self[:column],
    :byte_offset  => self[:byte_offset]
  }
end