Skip to content

Commit 0c638e8

Browse files
Weaken access requirements for Element internals
These methods were protected since day 1. If you only used RootElement, you didn't notice this, but HHVM did not allow RootElement to invoke your Element methods, unless you made them public. hhvm@next requires that RootElement have public methods, since calling protected interface methods is banned. This is a breaking change, but users that used sgml-stream (with or without non-RootElement elements) would not notice, unless their custom element type has never been rendered.
1 parent 550bce7 commit 0c638e8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Element.hack

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ interface Element extends ToSGMLStringAsync, Streamable {
2525
* Returns the direct children of an Element. If an element has no children,
2626
* an empty vec must be returned.
2727
*/
28-
protected function getChildren()[]: vec<XHPChild>;
28+
public function getChildren()[]: vec<XHPChild>;
2929

3030
/**
3131
* Must return all assigned data- and aria- attributes and all data- and aria-
@@ -34,13 +34,13 @@ interface Element extends ToSGMLStringAsync, Streamable {
3434
* attribute has a non arraykey value, either an exception must be thrown, the
3535
* value must be cast to an arraykey, or the value must be filtered out.
3636
*/
37-
protected function getDataAndAriaAttributes()[]: dict<string, arraykey>;
37+
public function getDataAndAriaAttributes()[]: dict<string, arraykey>;
3838

3939
/**
4040
* Must return all assigned declared attributes and all declared attributes
4141
* with a default value. If an attribute has both a default value and an
4242
* assigned value, the assigned value must be used. Declared aria- and data-
4343
* attributes must be filtered out.
4444
*/
45-
protected function getDeclaredAttributes()[]: dict<string, nonnull>;
45+
public function getDeclaredAttributes()[]: dict<string, nonnull>;
4646
}

0 commit comments

Comments
 (0)