我最近发现,当可聚焦元素中包含一些内容并分配有 aria-labelledby 属性时,MacOS 的 VoiceOver 不会读取标签内的内容,而是读取焦点组件的内容
在不同浏览器中尝试:在 Safari (11.1.1) 中按预期工作,但在 Chrome (76.0.3809.100) 中失败。还尝试改变两个元素的角色。
<p id="header">This text should be read</p>
<div tabindex="0" aria-labelledby="header">
<span>Click me</span>
<p>This text should not be read</p>
</div>
Run Code Online (Sandbox Code Playgroud)
https://jsfiddle.net/2d9jn4hs/
当您在打开div
VoiceOver 的情况下专注于声音时,我希望听到This text should be read
但听到的Click me This text should not be read
却是。
有什么建议吗?
所以这是一个关于动态内存分配和对象创建的C++练习.基本上 - 一个自定义类学生和一个自定义类组,它保留了一系列指向学生内部的指针.Group的析构函数显然存在问题,但我花了几个小时阅读手册和浏览论坛,但仍然无法理解我做错了什么.
欢迎任何评论.
UPD:问题是 - 退出时出错."调试断言失败了...... _BLOCK_TYPE_IS_VALID ......"
class Student{
char *firstName;
char *lastName;
public:
Student(): firstName(NULL), lastName(NULL){}
Student(const char *fname, const char *lname){
firstName = new char[32];
lastName = new char[32];
strcpy_s(firstName, 32, fname);
strcpy_s(lastName, 32, lname);
}
void Show(){
cout << firstName << " " << lastName << endl;
}
~Student(){
if(lastName != NULL)
delete[] lastName;
if(firstName != NULL)
delete[] firstName;
}
};
class Group{
Student *students;
int studentCounter;
public:
Group(){
students = NULL;
}
Group(const int …
Run Code Online (Sandbox Code Playgroud)