Skip to content

Commit

Permalink
Committing clang-format changes
Browse files Browse the repository at this point in the history
  • Loading branch information
openkraken-bot committed Dec 9, 2021
1 parent fea833d commit bf81dc6
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 23 deletions.
6 changes: 3 additions & 3 deletions bridge/bindings/qjs/dom/element.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
*/

#include "element.h"
#include "elements/template_element.h"
#include "bindings/qjs/bom/blob.h"
#include "bindings/qjs/html_parser.h"
#include "dart_methods.h"
#include "document.h"
#include "elements/template_element.h"
#include "text_node.h"

namespace kraken::binding::qjs {
Expand Down Expand Up @@ -562,7 +562,7 @@ PROP_SETTER(Element, innerHTML)(QjsContext* ctx, JSValue this_val, int argc, JSV
const char* chtml = JS_ToCString(ctx, argv[0]);

if (element->hasNodeFlag(NodeInstance::NodeFlag::IsTemplateElement)) {
auto *templateElement = static_cast<TemplateElementInstance*>(element);
auto* templateElement = static_cast<TemplateElementInstance*>(element);
HTMLParser::parseHTML(chtml, strlen(chtml), templateElement->content());
} else {
HTMLParser::parseHTML(chtml, strlen(chtml), element);
Expand Down Expand Up @@ -714,7 +714,7 @@ std::string ElementInstance::innerHTML() {
std::string s;

// If Element is TemplateElement, the innerHTML content is the content of documentFragment.
NodeInstance *parent = this;
NodeInstance* parent = this;
if (hasNodeFlag(NodeInstance::NodeFlag::IsTemplateElement)) {
parent = static_cast<TemplateElementInstance*>(this)->content();
}
Expand Down
30 changes: 15 additions & 15 deletions bridge/bindings/qjs/dom/element.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,21 +91,21 @@ class Element : public Node {

private:
DEFINE_PROTOTYPE_READONLY_PROPERTY(15,
nodeName,
tagName,
offsetLeft,
offsetTop,
offsetWidth,
offsetHeight,
clientWidth,
clientHeight,
clientTop,
clientLeft,
scrollHeight,
scrollWidth,
firstElementChild,
lastElementChild,
children);
nodeName,
tagName,
offsetLeft,
offsetTop,
offsetWidth,
offsetHeight,
clientWidth,
clientHeight,
clientTop,
clientLeft,
scrollHeight,
scrollWidth,
firstElementChild,
lastElementChild,
children);
DEFINE_PROTOTYPE_PROPERTY(5, className, innerHTML, outerHTML, scrollTop, scrollLeft);

ObjectFunction m_getBoundingClientRect{m_context, m_prototypeObject, "getBoundingClientRect", getBoundingClientRect, 0};
Expand Down
5 changes: 2 additions & 3 deletions bridge/bindings/qjs/dom/elements/template_element.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,15 @@ JSValue TemplateElement::instanceConstructor(QjsContext* ctx, JSValue func_obj,
return instance->instanceObject;
}

DocumentFragmentInstance * TemplateElementInstance::content() const {
DocumentFragmentInstance* TemplateElementInstance::content() const {
return static_cast<DocumentFragmentInstance*>(JS_GetOpaque(m_content.value(), DocumentFragment::classId()));
}

TemplateElementInstance::TemplateElementInstance(TemplateElement* element) : ElementInstance(element, "template", true) {
setNodeFlag(NodeFlag::IsTemplateElement);
}

TemplateElementInstance::~TemplateElementInstance() {
}
TemplateElementInstance::~TemplateElementInstance() {}

void TemplateElementInstance::gcMark(JSRuntime* rt, JSValue val, JS_MarkFunc* mark_func) {
NodeInstance::gcMark(rt, val, mark_func);
Expand Down
2 changes: 1 addition & 1 deletion bridge/bindings/qjs/dom/elements/template_element.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class TemplateElementInstance : public ElementInstance {
explicit TemplateElementInstance(TemplateElement* element);
~TemplateElementInstance();

DocumentFragmentInstance *content() const;
DocumentFragmentInstance* content() const;

protected:
void gcMark(JSRuntime* rt, JSValue val, JS_MarkFunc* mark_func) override;
Expand Down
1 change: 0 additions & 1 deletion bridge/bindings/qjs/dom/node_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ console.log(
EXPECT_EQ(logCalled, true);
}


TEST(Node, aaa) {
std::string code = R"(
const t = document.createElement('template')
Expand Down

0 comments on commit bf81dc6

Please sign in to comment.