ladybird/Libraries/LibHTML/DOMComputedElementStyleModel.h
Matrix89 988d1deca8 Browser+LibHTML: Add "Computed" styles to the DOM inspector
I though it would be nice to also show the style that the browser uses
to display an element.

In order to do that, in place of the styles table I've put a tab widget,
with tabs for both element and computed element styles.
2020-01-05 17:13:22 +01:00

33 lines
1,008 B
C++

#include <AK/NonnullRefPtrVector.h>
#include <LibGUI/GModel.h>
class Element;
class DOMComputedElementStyleModel final : public GModel {
public:
enum Column {
PropertyName,
PropertyValue,
__Count
};
static NonnullRefPtr<DOMComputedElementStyleModel> create(const Element& element) { return adopt(*new DOMComputedElementStyleModel(element)); }
virtual int row_count(const GModelIndex& = GModelIndex()) const override;
virtual int column_count(const GModelIndex& = GModelIndex()) const override { return Column::__Count; }
virtual String column_name(int) const override;
virtual GVariant data(const GModelIndex&, Role = Role::Display) const override;
virtual void update() override;
private:
explicit DOMComputedElementStyleModel(const Element&);
const Element& element() const { return *m_element; }
NonnullRefPtr<Element> m_element;
struct Value {
String name;
String value;
};
Vector<Value> m_values;
};